70 |
70 |
71 self.__setDiskCache() |
71 self.__setDiskCache() |
72 self.languagesChanged() |
72 self.languagesChanged() |
73 |
73 |
74 if SSL_AVAILABLE: |
74 if SSL_AVAILABLE: |
75 sslCfg = QSslConfiguration.defaultConfiguration() |
75 caList = self.__getSystemCaCertificates() |
76 caList = sslCfg.caCertificates() |
|
77 certificateDict = Preferences.toDict( |
76 certificateDict = Preferences.toDict( |
78 Preferences.Prefs.settings.value("Help/CaCertificatesDict")) |
77 Preferences.Prefs.settings.value("Help/CaCertificatesDict")) |
79 for server in certificateDict: |
78 for server in certificateDict: |
80 for cert in QSslCertificate.fromData(certificateDict[server]): |
79 for cert in QSslCertificate.fromData(certificateDict[server]): |
81 if cert not in caList: |
80 if cert not in caList: |
82 caList.append(cert) |
81 caList.append(cert) |
|
82 sslCfg = QSslConfiguration.defaultConfiguration() |
83 sslCfg.setCaCertificates(caList) |
83 sslCfg.setCaCertificates(caList) |
84 QSslConfiguration.setDefaultConfiguration(sslCfg) |
84 QSslConfiguration.setDefaultConfiguration(sslCfg) |
85 |
85 |
86 self.sslErrors.connect(self.__sslErrors) |
86 self.sslErrors.connect(self.__sslErrors) |
87 |
87 |
298 |
298 |
299 result += "</p>" |
299 result += "</p>" |
300 |
300 |
301 return result |
301 return result |
302 |
302 |
|
303 def __getSystemCaCertificates(self): |
|
304 """ |
|
305 Private method to get the list of system certificates. |
|
306 |
|
307 @return list of system certificates (list of QSslCertificate) |
|
308 """ |
|
309 caList = QSslCertificate.fromData(Preferences.toByteArray( |
|
310 Preferences.Prefs.settings.value("Help/SystemCertificates"))) |
|
311 if not caList: |
|
312 caList = QSslSocket.systemCaCertificates() |
|
313 return caList |
|
314 |
303 def preferencesChanged(self): |
315 def preferencesChanged(self): |
304 """ |
316 """ |
305 Public slot to signal a change of preferences. |
317 Public slot to signal a change of preferences. |
306 """ |
318 """ |
307 self.__setDiskCache() |
319 self.__setDiskCache() |