Always falback to plaintext on TLS-related failure

This commit is contained in:
Etoh 2022-11-05 20:10:39 +00:00 committed by GitHub
parent e9f506f713
commit 5c2398d4cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,7 @@ class SyncClientProtocol(JSONCommandProtocol):
self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server")) self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server"))
self.sendHello() self.sendHello()
else: else:
self._client.ui.showMessage(getMessage("startTLS-not-supported-client")) self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-client"))
self.sendHello() self.sendHello()
def connectionLost(self, reason): def connectionLost(self, reason):
@ -102,9 +102,13 @@ class SyncClientProtocol(JSONCommandProtocol):
elif "tlsv1 alert protocol version" in str(reason.value): elif "tlsv1 alert protocol version" in str(reason.value):
self._client._clientSupportsTLS = False self._client._clientSupportsTLS = False
elif "certificate verify failed" in str(reason.value): elif "certificate verify failed" in str(reason.value):
self.dropWithError(getMessage("startTLS-server-certificate-invalid")) self._client.ui.showErrorMessage(getMessage("startTLS-server-certificate-invalid"))
self._client._clientSupportsTLS = False
elif "mismatched_id=DNS_ID" in str(reason.value): elif "mismatched_id=DNS_ID" in str(reason.value):
self.dropWithError(getMessage("startTLS-server-certificate-invalid-DNS-ID")) self._client.ui.showErrorMessage(getMessage("startTLS-server-certificate-invalid-DNS-ID"))
self._client._clientSupportsTLS = False
elif "tls" in str(reason.stack):
self._client._clientSupportsTLS = False
except: except:
pass pass
self._client.destroyProtocol() self._client.destroyProtocol()