MCPcopy Index your code
hub / github.com/python/cpython / prot_p

Method prot_p

Lib/ftplib.py:746–760  ·  view source on GitHub ↗

Set up secure data connection.

(self)

Source from the content-addressed store, hash-verified

744 return resp
745
746 def prot_p(self):
747 '''Set up secure data connection.'''
748 # PROT defines whether or not the data channel is to be protected.
749 # Though RFC-2228 defines four possible protection levels,
750 # RFC-4217 only recommends two, Clear and Private.
751 # Clear (PROT C) means that no security is to be used on the
752 # data-channel, Private (PROT P) means that the data-channel
753 # should be protected by TLS.
754 # PBSZ command MUST still be issued, but must have a parameter of
755 # '0' to indicate that no buffering is taking place and the data
756 # connection should not be encapsulated.
757 self.voidcmd('PBSZ 0')
758 resp = self.voidcmd('PROT P')
759 self._prot_p = True
760 return resp
761
762 def prot_c(self):
763 '''Set up clear text data connection.'''

Callers 4

setUpMethod · 0.80
test_data_connectionMethod · 0.80
test_contextMethod · 0.80
test_check_hostnameMethod · 0.80

Calls 1

voidcmdMethod · 0.80

Tested by 4

setUpMethod · 0.64
test_data_connectionMethod · 0.64
test_contextMethod · 0.64
test_check_hostnameMethod · 0.64