Showing the changes to interface/src/ui/OAuthWebViewHandler.cpp (1 of 4 files). Show all
Unified · Split
| @@ -26,10 +26,24 @@ OAuthWebViewHandler::OAuthWebViewHandler() : · 25 unmodified lines | |||
| 26 | 26 | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig() { | ||
| 30 | QSslConfiguration sslConfig = QSslConfiguration::defaultConfiguration(); | ||
| 31 | |||
| 32 | // add the High Fidelity root CA to the list of trusted CA certificates | ||
| 33 | QByteArray highFidelityCACertificate(reinterpret_cast<char*>(DTLSSession::highFidelityCADatum()->data), | ||
| 34 | DTLSSession::highFidelityCADatum()->size); | ||
| 35 | sslConfig.setCaCertificates(sslConfig.caCertificates() + QSslCertificate::fromData(highFidelityCACertificate)); | ||
| 36 | |||
| 37 | // set the modified configuration | ||
| 38 | QSslConfiguration::setDefaultConfiguration(sslConfig); | ||
| 39 | } | ||
| 40 | |||
| 29 | void OAuthWebViewHandler::displayWebviewForAuthorizationURL(const QUrl& authorizationURL) { | 41 | void OAuthWebViewHandler::displayWebviewForAuthorizationURL(const QUrl& authorizationURL) { |
| 30 | if (!_activeWebView) { | 42 | if (!_activeWebView) { |
| 31 | _activeWebView = new QWebView(); | 43 | _activeWebView = new QWebView(); |
| 32 | _activeWebView->setWindowFlags(Qt::WindowStaysOnTopHint); | 44 | _activeWebView->setWindowFlags(Qt::WindowStaysOnTopHint); |
| 45 | |||
| 46 | qDebug() << "Displaying QWebView for OAuth authorization at" << authorizationURL.toString(); | ||
| 33 | _activeWebView->load(authorizationURL); | 47 | _activeWebView->load(authorizationURL); |
| 34 | _activeWebView->show(); | 48 | _activeWebView->show(); |
| 35 | 49 | ||