eric7/EricNetwork/EricSslInfoWidget.py

branch
eric7
changeset 8631
b2c4c2f3fda7
parent 8601
018c48d7ae3c
child 8638
218bc66da8c0
--- a/eric7/EricNetwork/EricSslInfoWidget.py	Fri Sep 24 16:34:46 2021 +0200
+++ b/eric7/EricNetwork/EricSslInfoWidget.py	Fri Sep 24 17:37:38 2021 +0200
@@ -164,14 +164,26 @@
             
             label = QLabel(self)
             label.setWordWrap(True)
-            label.setText(self.tr(
-                "It is encrypted using {0} at {1} bits, "
-                "with {2} for message authentication and "
-                "{3} as key exchange mechanism.\n\n").format(
-                cipher.encryptionMethod(),
-                cipher.usedBits(),
-                cipher.authenticationMethod(),
-                cipher.keyExchangeMethod()))
+            if (
+                not cipher.encryptionMethod() or
+                not cipher.usedBits() or
+                not cipher.authenticationMethod() or
+                not cipher.keyExchangeMethod()
+            ):
+                label.setText(self.tr(
+                    "The cipher data is incomplete or not known."
+                ))
+            else:
+                label.setText(self.tr(
+                    "It is encrypted using {0} at {1} bits, "
+                    "with {2} for message authentication and "
+                    "{3} as key exchange mechanism.\n\n").format(
+                    cipher.encryptionMethod(),
+                    cipher.usedBits(),
+                    cipher.authenticationMethod(),
+                    cipher.keyExchangeMethod()
+                    )
+                )
             layout.addWidget(label, rows, 1)
             rows += 1
     

eric ide

mercurial