E5SslErrorHandler: some tweaking of the SSL setup code.

Sat, 08 Dec 2018 16:30:16 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 08 Dec 2018 16:30:16 +0100
changeset 6607
5237edb40b88
parent 6606
593488c37f2c
child 6608
954711fa91d8

E5SslErrorHandler: some tweaking of the SSL setup code.

E5Network/E5SslErrorHandler.py file | annotate | diff | comparison | revisions
--- a/E5Network/E5SslErrorHandler.py	Fri Dec 07 20:25:59 2018 +0100
+++ b/E5Network/E5SslErrorHandler.py	Sat Dec 08 16:30:16 2018 +0100
@@ -57,7 +57,10 @@
                     caList.append(cert)
         sslCfg = QSslConfiguration.defaultConfiguration()
         sslCfg.setCaCertificates(caList)
-        sslCfg.setProtocol(QSsl.AnyProtocol)
+        try:
+            sslCfg.setProtocol(QSsl.TlsV1_1OrLater)
+        except AttributeError:
+            sslCfg.setProtocol(QSsl.SecureProtocols)
         try:
             sslCfg.setSslOption(QSsl.SslOptionDisableCompression, True)
         except AttributeError:
@@ -166,7 +169,15 @@
                     for cert in caNew:
                         caList.append(cert)
                     sslCfg.setCaCertificates(caList)
-                    sslCfg.setProtocol(QSsl.AnyProtocol)
+                    try:
+                        sslCfg.setProtocol(QSsl.TlsV1_1OrLater)
+                    except AttributeError:
+                        sslCfg.setProtocol(QSsl.SecureProtocols)
+                    try:
+                        sslCfg.setSslOption(QSsl.SslOptionDisableCompression,
+                                            True)
+                    except AttributeError:
+                        pass
                     QSslConfiguration.setDefaultConfiguration(sslCfg)
                     
                     certificateDict = {}

eric ide

mercurial