eric6/E5Network/E5SslErrorHandler.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8176
31965986ecd1
child 8218
7c09585bd960
--- a/eric6/E5Network/E5SslErrorHandler.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/E5Network/E5SslErrorHandler.py	Tue Mar 02 17:17:09 2021 +0100
@@ -58,14 +58,15 @@
         sslCfg = QSslConfiguration.defaultConfiguration()
         sslCfg.setCaCertificates(caList)
         try:
-            sslProtocol = QSsl.TlsV1_1OrLater
+            sslProtocol = QSsl.SslProtocol.TlsV1_1OrLater
             if Globals.isWindowsPlatform() and platform.win32_ver()[0] == '7':
-                sslProtocol = QSsl.SecureProtocols
+                sslProtocol = QSsl.SslProtocol.SecureProtocols
         except AttributeError:
-            sslProtocol = QSsl.SecureProtocols
+            sslProtocol = QSsl.SslProtocol.SecureProtocols
         sslCfg.setProtocol(sslProtocol)
         try:
-            sslCfg.setSslOption(QSsl.SslOptionDisableCompression, True)
+            sslCfg.setSslOption(QSsl.SslOption.SslOptionDisableCompression,
+                                True)
         except AttributeError:
             pass
         QSslConfiguration.setDefaultConfiguration(sslCfg)
@@ -125,7 +126,7 @@
             server += ":{0:d}".format(port)
         if errors:
             for err in errors:
-                if err.error() == QSslError.NoError:
+                if err.error() == QSslError.SslError.NoError:
                     continue
                 if server in caMerge and err.certificate() in caMerge[server]:
                     continue
@@ -173,12 +174,13 @@
                         caList.append(cert)
                     sslCfg.setCaCertificates(caList)
                     try:
-                        sslCfg.setProtocol(QSsl.TlsV1_1OrLater)
+                        sslCfg.setProtocol(QSsl.SslProtocol.TlsV1_1OrLater)
                     except AttributeError:
-                        sslCfg.setProtocol(QSsl.SecureProtocols)
+                        sslCfg.setProtocol(QSsl.SslProtocol.SecureProtocols)
                     try:
-                        sslCfg.setSslOption(QSsl.SslOptionDisableCompression,
-                                            True)
+                        sslCfg.setSslOption(
+                            QSsl.SslOption.SslOptionDisableCompression,
+                            True)
                     except AttributeError:
                         pass
                     QSslConfiguration.setDefaultConfiguration(sslCfg)
@@ -212,7 +214,8 @@
         ).format(
             Utilities.html_encode(
                 Utilities.decodeString(
-                    ", ".join(cert.subjectInfo(QSslCertificate.CommonName))
+                    ", ".join(cert.subjectInfo(
+                        QSslCertificate.SubjectInfo.CommonName))
                 )
             )
         )
@@ -222,7 +225,8 @@
         ).format(
             Utilities.html_encode(
                 Utilities.decodeString(
-                    ", ".join(cert.subjectInfo(QSslCertificate.Organization))
+                    ", ".join(cert.subjectInfo(
+                        QSslCertificate.SubjectInfo.Organization))
                 )
             )
         )
@@ -232,7 +236,8 @@
         ).format(
             Utilities.html_encode(
                 Utilities.decodeString(
-                    ", ".join(cert.issuerInfo(QSslCertificate.CommonName))
+                    ", ".join(cert.issuerInfo(
+                        QSslCertificate.SubjectInfo.CommonName))
                 )
             )
         )

eric ide

mercurial