~ubuntuone-control-tower/ubuntu-sso-client/trunk

« back to all changes in this revision

Viewing changes to ubuntu_sso/utils/webclient/qtnetwork.py

  • Committer: Tarmac
  • Author(s): Rodney Dawes
  • Date: 2013-10-23 23:41:21 UTC
  • mfrom: (1034.1.1 ssl-force-load)
  • Revision ID: tarmac-20131023234121-gdep3a32krgbl4u2
Force loading of the system certificates in Qt, to avoid breaking certificate
checks on non-Ubuntu URLs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    QNetworkRequest,
51
51
    QSslCertificate,
52
52
    QSslConfiguration,
 
53
    QSslSocket,
53
54
)
54
55
from twisted.internet import defer
55
56
 
106
107
        self.proxy_retry = False
107
108
        self.setup_proxy()
108
109
 
 
110
        # Force Qt to load the system certificates
 
111
        QSslSocket.setDefaultCaCertificates(QSslSocket.systemCaCertificates())
109
112
        # Apply our local certificates as the SSL configuration to be used
110
113
        # for all QNetworkRequest calls.
111
114
        self.ssl_config = QSslConfiguration.defaultConfiguration()