MCPcopy Index your code
hub / github.com/Syncplay/syncplay / handleTLS

Method handleTLS

syncplay/protocols.py:376–386  ·  view source on GitHub ↗
(self, message)

Source from the content-addressed store, hash-verified

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

Callers 1

handleMessagesMethod · 0.45

Calls 3

sendHelloMethod · 0.95
getMessageFunction · 0.90
showErrorMessageMethod · 0.45

Tested by

no test coverage detected