Set up secure control connection by using TLS/SSL.
(self)
| 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.''' |
no test coverage detected