QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
|
SSL error handler, used for responding to SSL errors encountered during network requests. More...
#include <qgsnetworkaccessmanager.h>
Public Member Functions | |
virtual | ~QgsSslErrorHandler ()=default |
virtual void | handleSslErrors (QNetworkReply *reply, const QList< QSslError > &errors) |
Called whenever SSL errors are encountered during a network reply. More... | |
SSL error handler, used for responding to SSL errors encountered during network requests.
QgsSslErrorHandler responds to SSL errors encountered during network requests. The base QgsSslErrorHandler class responds to SSL errors only by logging the errors, and uses the default Qt response, which is to abort the request.
Subclasses can override this behavior by implementing their own handleSslErrors() method. QgsSslErrorHandlers are ONLY ever called from the main thread, so it is safe to utilize gui widgets and dialogs during handleSslErrors (e.g. to present prompts to users notifying them of the errors and asking them to choose the appropriate response.).
If a reply is coming from background thread, that thread is blocked while handleSslErrors() is running.
If the errors should be ignored and the request allowed to proceed, the subclasses' handleSslErrors() method MUST call QNetworkReply::ignoreSslErrors() on the specified QNetworkReply object.
An application instance can only have a single SSL error handler. The current SSL error handler is set by calling QgsNetworkAccessManager::setSslErrorHandler(). By default an instance of the logging-only QgsSslErrorHandler base class is used.
Definition at line 173 of file qgsnetworkaccessmanager.h.
|
virtualdefault |
|
virtual |
Called whenever SSL errors are encountered during a network reply.
Subclasses should reimplement this method to implement their own logic regarding whether or not these SSL errors should be ignored, and how to present them to users.
The base class method just logs errors and leaves the default Qt response to SSL errors, which is to abort the network request on any errors.
Definition at line 859 of file qgsnetworkaccessmanager.cpp.