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

Method auth

Lib/ftplib.py:726–736  ·  view source on GitHub ↗

Set up secure control connection by using TLS/SSL.

(self)

Source from the content-addressed store, hash-verified

724 return super().login(user, passwd, acct)
725
726 def auth(self):
727 '''Set up secure control connection by using TLS/SSL.'''
728 if isinstance(self.sock, ssl.SSLSocket):
729 raise ValueError("Already using TLS")
730 if self.context.protocol >= ssl.PROTOCOL_TLS:
731 resp = self.voidcmd('AUTH TLS')
732 else:
733 resp = self.voidcmd('AUTH SSL')
734 self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host)
735 self.file = self.sock.makefile(mode='r', encoding=self.encoding)
736 return resp
737
738 def ccc(self):
739 '''Switch back to a clear-text control connection.'''

Callers 1

loginMethod · 0.95

Calls 3

voidcmdMethod · 0.80
wrap_socketMethod · 0.80
makefileMethod · 0.45

Tested by

no test coverage detected