E5SslErrorHandler: fixed a compatibility issue with Windows 7 causing SSL handshakes to fail (without sending the sslErrors signal).

Sat, 08 Dec 2018 20:32:27 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 08 Dec 2018 20:32:27 +0100
changeset 6613
7b7523fd4c80
parent 6612
87984e7f11d9
child 6614
973bd272a528

E5SslErrorHandler: fixed a compatibility issue with Windows 7 causing SSL handshakes to fail (without sending the sslErrors signal).

E5Network/E5SslErrorHandler.py file | annotate | diff | comparison | revisions
--- a/E5Network/E5SslErrorHandler.py	Sat Dec 08 18:54:11 2018 +0100
+++ b/E5Network/E5SslErrorHandler.py	Sat Dec 08 20:32:27 2018 +0100
@@ -9,6 +9,8 @@
 
 from __future__ import unicode_literals
 
+import platform
+
 from PyQt5.QtCore import QObject, QByteArray
 from PyQt5.QtNetwork import QSslCertificate, QSslConfiguration, QSslSocket, \
     QSslError, QSsl
@@ -58,9 +60,12 @@
         sslCfg = QSslConfiguration.defaultConfiguration()
         sslCfg.setCaCertificates(caList)
         try:
-            sslCfg.setProtocol(QSsl.TlsV1_1OrLater)
+            sslProtocol = QSsl.TlsV1_1OrLater
+            if Globals.isWindowsPlatform() and platform.win32_ver()[0] == '7':
+                sslProtocol = QSsl.SecureProtocols
         except AttributeError:
-            sslCfg.setProtocol(QSsl.SecureProtocols)
+            sslProtocol = QSsl.SecureProtocols
+        sslCfg.setProtocol(sslProtocol)
         try:
             sslCfg.setSslOption(QSsl.SslOptionDisableCompression, True)
         except AttributeError:

eric ide

mercurial