mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-20 13:06:49 +00:00
startTLS: separate not-supported messages for client and server
This commit is contained in:
parent
ff3e49b87d
commit
e6912dc659
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user