(self, message)
| 374 | self.sendMessage({"TLS": message}) |
| 375 | |
| 376 | def handleTLS(self, message): |
| 377 | answer = message["startTLS"] if "startTLS" in message else None |
| 378 | if "true" in answer and not self.logged and self._client.protocolFactory.options is not None: |
| 379 | self.transport.startTLS(self._client.protocolFactory.options) |
| 380 | # To be deleted when the support for Twisted between >=16.4.0 and < 17.1.0 is dropped |
| 381 | minTwistedVersion = Version('twisted', 17, 1, 0) |
| 382 | if twistedVersion < minTwistedVersion: |
| 383 | self._client.protocolFactory.options._ctx.set_info_callback(self.customHandshakeCallback) |
| 384 | elif "false" in answer: |
| 385 | self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server")) |
| 386 | self.sendHello() |
| 387 | |
| 388 | def customHandshakeCallback(self, conn, where, ret): |
| 389 | # To be deleted when the support for Twisted between >=16.4.0 and < 17.1.0 is dropped |
no test coverage detected