diff --git a/syncplay/client.py b/syncplay/client.py index 7a2b64d..37bd2b3 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -716,9 +716,10 @@ class SyncplayClient(object): self._endpoint = HostnameEndpoint(reactor, host, port) try: self.protocolFactory.options = optionsForClientTLS(hostname=host) + self._clientSupportsTLS = True except Exception as e: self.protocolFactory.options = None - self._serverSupportsTLS = False + self._clientSupportsTLS = False def retry(retries): self._lastGlobalUpdate = None diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 6c8b3d0..1adbfb9 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -313,7 +313,7 @@ de = { # startTLS messages - TODO: Translate "startTLS-initiated": "Attempting secure connection", "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-not-supported-client": "TLS is not supported", + "startTLS-not-supported-client": "This client does not support TLS", "startTLS-not-supported-server": "This server does not support TLS", # About dialog - TODO: Translate diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index b907614..2c8f84f 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -314,7 +314,7 @@ en = { "startTLS-initiated": "Attempting secure connection", "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-not-supported-client": "TLS is not supported", + "startTLS-not-supported-client": "This client does not support TLS", "startTLS-not-supported-server": "This server does not support TLS", # About dialog diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index cf31785..99fd305 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -314,7 +314,7 @@ it = { "startTLS-initiated": "Tentativo di connessione sicura in corso", "startTLS-secure-connection-ok": "Connessione sicura stabilita ({})", - "startTLS-not-supported-client": "TLS non รจ supportato", + "startTLS-not-supported-client": "Questo client non supporta TLS", "startTLS-not-supported-server": "Questo server non supporta TLS", # About dialog diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 01e9e1b..b4f6332 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -316,7 +316,7 @@ ru = { # startTLS messages - TODO: Translate "startTLS-initiated": "Attempting secure connection", "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-not-supported-client": "TLS is not supported", + "startTLS-not-supported-client": "This client does not support TLS", "startTLS-not-supported-server": "This server does not support TLS", # About dialog - TODO: Translate diff --git a/syncplay/protocols.py b/syncplay/protocols.py index d2a2522..0c65e6c 100755 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -77,11 +77,15 @@ class SyncClientProtocol(JSONCommandProtocol): def connectionMade(self): self._client.initProtocol(self) - if self._client._serverSupportsTLS: - self.sendTLS({"startTLS": "send"}) - self._client.ui.showMessage(getMessage("startTLS-initiated")) + if self._client._clientSupportsTLS: + if self._client._serverSupportsTLS: + self.sendTLS({"startTLS": "send"}) + self._client.ui.showMessage(getMessage("startTLS-initiated")) + else: + self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server")) + self.sendHello() else: - self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-client")) + self._client.ui.showMessage(getMessage("startTLS-not-supported-client")) self.sendHello() def connectionLost(self, reason):