(self, arg)
| 158 | if SUPPORTS_SSL: |
| 159 | |
| 160 | def cmd_stls(self, arg): |
| 161 | if self.tls_active is False: |
| 162 | self.push('+OK Begin TLS negotiation') |
| 163 | context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) |
| 164 | context.load_cert_chain(CERTFILE) |
| 165 | tls_sock = context.wrap_socket(self.socket, |
| 166 | server_side=True, |
| 167 | do_handshake_on_connect=False, |
| 168 | suppress_ragged_eofs=False) |
| 169 | self.del_channel() |
| 170 | self.set_socket(tls_sock) |
| 171 | self.tls_active = True |
| 172 | self.tls_starting = True |
| 173 | self.in_buffer = [] |
| 174 | self._do_tls_handshake() |
| 175 | else: |
| 176 | self.push('-ERR Command not permitted when TLS active') |
| 177 | |
| 178 | def _do_tls_handshake(self): |
| 179 | try: |
nothing calls this directly
no test coverage detected