45 |
45 |
46 ########################################## |
46 ########################################## |
47 ## Identity Information |
47 ## Identity Information |
48 ########################################## |
48 ########################################## |
49 imageLabel = QLabel(self) |
49 imageLabel = QLabel(self) |
50 layout.addWidget(imageLabel, rows, 0, Qt.AlignCenter) |
50 layout.addWidget(imageLabel, rows, 0, Qt.AlignmentFlag.AlignCenter) |
51 |
51 |
52 label = QLabel(self) |
52 label = QLabel(self) |
53 label.setWordWrap(True) |
53 label.setWordWrap(True) |
54 label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) |
54 label.setSizePolicy(QSizePolicy.Policy.Expanding, |
|
55 QSizePolicy.Policy.Preferred) |
55 label.setText(self.tr("Identity")) |
56 label.setText(self.tr("Identity")) |
56 font = label.font() |
57 font = label.font() |
57 font.setBold(True) |
58 font.setBold(True) |
58 label.setFont(font) |
59 label.setFont(font) |
59 layout.addWidget(label, rows, 1) |
60 layout.addWidget(label, rows, 1) |
67 imageLabel.setPixmap(UI.PixmapCache.getPixmap("securityLow32")) |
68 imageLabel.setPixmap(UI.PixmapCache.getPixmap("securityLow32")) |
68 else: |
69 else: |
69 valid = not cert.isBlacklisted() |
70 valid = not cert.isBlacklisted() |
70 if valid: |
71 if valid: |
71 txt = ", ".join( |
72 txt = ", ".join( |
72 cert.issuerInfo(QSslCertificate.CommonName)) |
73 cert.issuerInfo(QSslCertificate.SubjectInfo.CommonName)) |
73 label.setText(self.tr( |
74 label.setText(self.tr( |
74 "The certificate for this site is valid" |
75 "The certificate for this site is valid" |
75 " and has been verified by:\n{0}").format( |
76 " and has been verified by:\n{0}").format( |
76 Utilities.decodeString(txt))) |
77 Utilities.decodeString(txt))) |
77 imageLabel.setPixmap( |
78 imageLabel.setPixmap( |
95 |
96 |
96 ########################################## |
97 ########################################## |
97 ## Identity Information |
98 ## Identity Information |
98 ########################################## |
99 ########################################## |
99 imageLabel = QLabel(self) |
100 imageLabel = QLabel(self) |
100 layout.addWidget(imageLabel, rows, 0, Qt.AlignCenter) |
101 layout.addWidget(imageLabel, rows, 0, Qt.AlignmentFlag.AlignCenter) |
101 |
102 |
102 label = QLabel(self) |
103 label = QLabel(self) |
103 label.setWordWrap(True) |
104 label.setWordWrap(True) |
104 label.setText(self.tr("Encryption")) |
105 label.setText(self.tr("Encryption")) |
105 font = label.font() |
106 font = label.font() |
125 'Your connection to "{0}" is encrypted.').format( |
126 'Your connection to "{0}" is encrypted.').format( |
126 self.__url.host())) |
127 self.__url.host())) |
127 layout.addWidget(label, rows, 1) |
128 layout.addWidget(label, rows, 1) |
128 |
129 |
129 proto = cipher.protocol() |
130 proto = cipher.protocol() |
130 if proto == QSsl.SslV3: |
131 if proto == QSsl.SslProtocol.SslV3: |
131 sslVersion = "SSL 3.0" |
132 sslVersion = "SSL 3.0" |
132 imageLabel.setPixmap( |
133 imageLabel.setPixmap( |
133 UI.PixmapCache.getPixmap("securityLow32")) |
134 UI.PixmapCache.getPixmap("securityLow32")) |
134 elif proto == QSsl.TlsV1SslV3: |
135 elif proto == QSsl.SslProtocol.TlsV1SslV3: |
135 sslVersion = "TLS 1.0/SSL 3.0" |
136 sslVersion = "TLS 1.0/SSL 3.0" |
136 imageLabel.setPixmap( |
137 imageLabel.setPixmap( |
137 UI.PixmapCache.getPixmap("securityLow32")) |
138 UI.PixmapCache.getPixmap("securityLow32")) |
138 elif proto == QSsl.SslV2: |
139 elif proto == QSsl.SslProtocol.SslV2: |
139 sslVersion = "SSL 2.0" |
140 sslVersion = "SSL 2.0" |
140 imageLabel.setPixmap( |
141 imageLabel.setPixmap( |
141 UI.PixmapCache.getPixmap("securityLow32")) |
142 UI.PixmapCache.getPixmap("securityLow32")) |
142 else: |
143 else: |
143 sslVersion = self.tr("unknown") |
144 sslVersion = self.tr("unknown") |
144 imageLabel.setPixmap( |
145 imageLabel.setPixmap( |
145 UI.PixmapCache.getPixmap("securityLow32")) |
146 UI.PixmapCache.getPixmap("securityLow32")) |
146 if proto == QSsl.TlsV1_0: |
147 if proto == QSsl.SslProtocol.TlsV1_0: |
147 sslVersion = "TLS 1.0" |
148 sslVersion = "TLS 1.0" |
148 imageLabel.setPixmap( |
149 imageLabel.setPixmap( |
149 UI.PixmapCache.getPixmap("securityHigh32")) |
150 UI.PixmapCache.getPixmap("securityHigh32")) |
150 elif proto == QSsl.TlsV1_1: |
151 elif proto == QSsl.SslProtocol.TlsV1_1: |
151 sslVersion = "TLS 1.1" |
152 sslVersion = "TLS 1.1" |
152 imageLabel.setPixmap( |
153 imageLabel.setPixmap( |
153 UI.PixmapCache.getPixmap("securityHigh32")) |
154 UI.PixmapCache.getPixmap("securityHigh32")) |
154 elif proto == QSsl.TlsV1_2: |
155 elif proto == QSsl.SslProtocol.TlsV1_2: |
155 sslVersion = "TLS 1.2" |
156 sslVersion = "TLS 1.2" |
156 imageLabel.setPixmap( |
157 imageLabel.setPixmap( |
157 UI.PixmapCache.getPixmap("securityHigh32")) |
158 UI.PixmapCache.getPixmap("securityHigh32")) |
158 elif proto == QSsl.TlsV1_3: |
159 elif proto == QSsl.SslProtocol.TlsV1_3: |
159 sslVersion = "TLS 1.3" |
160 sslVersion = "TLS 1.3" |
160 imageLabel.setPixmap( |
161 imageLabel.setPixmap( |
161 UI.PixmapCache.getPixmap("securityHigh32")) |
162 UI.PixmapCache.getPixmap("securityHigh32")) |
162 rows += 1 |
163 rows += 1 |
163 |
164 |