Skip to content
Permalink
Browse files
record which SSL errors are ok to ignore
git-svn-id: http://svn.osgeo.org/qgis/trunk@15182 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 17, 2011
1 parent 5b23cf6 commit 03653c1bbfb92460a65d3fe03f876b40eb1b3eb5
Showing with 11 additions and 5 deletions.
  1. +11 −5 src/app/qgisapp.cpp
@@ -7218,23 +7218,29 @@ void QgisApp::namSslErrors( QNetworkReply *reply, const QList<QSslError> &errors
{
QString msg = tr( "SSL errors occured accessing URL %1:" ).arg( reply->request().url().toString() );
bool otherError = false;
static QSet<QSslError::SslError> ignoreErrors;

foreach( QSslError error, errors )
{
if ( error.error() != QSslError::SelfSignedCertificate &&
error.error() != QSslError::HostNameMismatch )
otherError = true;
QgsDebugMsg( QString( "SSL error %1: %2" ).arg( error.error() ).arg( error.errorString() ) );

otherError = otherError || !ignoreErrors.contains( error.error() );

msg += "\n" + error.errorString();
}

msg += tr( "\n\nIgnore errors?" );
msg += tr( "\n\nAlways ignore these errors?" );

if ( !otherError ||
QMessageBox::warning( this,
tr( "SSL errors occured" ),
tr( "%n SSL errors occured", "number of errors", errors.size() ),
msg,
QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Ok )
{
foreach( QSslError error, errors )
{
ignoreErrors << error.error();
}
reply->ignoreSslErrors();
}
}

0 comments on commit 03653c1

Please sign in to comment.