Set up secure control connection by using TLS/SSL.
(self)
| 746 | return super().login(user, passwd, acct) |
| 747 | |
| 748 | def auth(self): |
| 749 | '''Set up secure control connection by using TLS/SSL.''' |
| 750 | if isinstance(self.sock, ssl.SSLSocket): |
| 751 | raise ValueError("Already using TLS") |
| 752 | if self.ssl_version >= ssl.PROTOCOL_TLS: |
| 753 | resp = self.voidcmd('AUTH TLS') |
| 754 | else: |
| 755 | resp = self.voidcmd('AUTH SSL') |
| 756 | self.sock = self.context.wrap_socket(self.sock, server_hostname=self.host) |
| 757 | self.file = self.sock.makefile(mode='r', encoding=self.encoding) |
| 758 | return resp |
| 759 | |
| 760 | def ccc(self): |
| 761 | '''Switch back to a clear-text control connection.''' |
no test coverage detected