@@ -6528,6 +6528,9 @@ void QgisApp::namSetup()
6528
6528
6529
6529
connect ( nam, SIGNAL ( proxyAuthenticationRequired ( const QNetworkProxy &, QAuthenticator * ) ),
6530
6530
this , SLOT ( namProxyAuthenticationRequired ( const QNetworkProxy &, QAuthenticator * ) ) );
6531
+
6532
+ connect ( nam, SIGNAL ( sslErrors ( QNetworkReply *, const QList<QSslError> & ) ),
6533
+ this , SLOT ( namSslErrors ( QNetworkReply *, const QList<QSslError> & ) ) );
6531
6534
}
6532
6535
6533
6536
void QgisApp::namAuthenticationRequired ( QNetworkReply *reply, QAuthenticator *auth )
@@ -6562,6 +6565,31 @@ void QgisApp::namProxyAuthenticationRequired( const QNetworkProxy &proxy, QAuthe
6562
6565
auth->setPassword ( password );
6563
6566
}
6564
6567
6568
+ void QgisApp::namSslErrors ( QNetworkReply *reply, const QList<QSslError> &errors )
6569
+ {
6570
+ QString msg = tr ( " SSL errors occured accessing URL %1:" ).arg ( reply->request ().url ().toString () );
6571
+ bool otherError = false ;
6572
+
6573
+ foreach ( QSslError error, errors )
6574
+ {
6575
+ if ( error.error () != QSslError::SelfSignedCertificate &&
6576
+ error.error () != QSslError::HostNameMismatch )
6577
+ otherError = true ;
6578
+ msg += " \n " + error.errorString ();
6579
+ }
6580
+
6581
+ msg += tr ( " \n\n Ignore errors?" );
6582
+
6583
+ if ( !otherError ||
6584
+ QMessageBox::warning ( this ,
6585
+ tr ( " SSL errors occured" ),
6586
+ msg,
6587
+ QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
6588
+ {
6589
+ reply->ignoreSslErrors ();
6590
+ }
6591
+ }
6592
+
6565
6593
void QgisApp::namUpdate ()
6566
6594
{
6567
6595
QNetworkProxy proxy;
0 commit comments