KDAV::DavSslUiProxy Class
class KDAV::DavSslUiProxyInterface to display SSL errors and requesting user input. More...
| Header: | #include <KDAV/DavSslUiProxy> |
| CMake: | find_package(KF6 REQUIRED COMPONENTS DAV)target_link_libraries(mytarget PRIVATE KF6::DAV) |
| Since: | 6.29 |
Public Functions
| virtual bool | ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &sslErrors) = 0 |
Static Public Members
| void | setDefaultProxy(std::unique_ptr<KDAV::DavSslUiProxy> &&proxy) |
Detailed Description
Member Function Documentation
[pure virtual] bool DavSslUiProxy::ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &sslErrors)
Show an SSL error and ask the user whether it should be ignored or not. The recommended KDE UI is the following:
#include <KSslErrorUiData> #include <KIO/SslUi> class UiProxy: public DavSslUiProxy { public: bool ignoreSslErrors(QNetworkReply *reply, const QList<QSslError> &sslErrors) override { KSslErrorUiData errorData(reply, sslErrors); if (KIO::SslUi::askIgnoreSslErrors(errorData)) { return true; } else { return false; } } }; [...] auto proxy = std::make_unique<UiProxy>(); DavSslUiProxy::setDefaultProxy(std::move(proxy));
reply is the request which got errors sslErrors contains details about the encountered SSL errors.
Returns true if the error can be ignored
[static] void DavSslUiProxy::setDefaultProxy(std::unique_ptr<KDAV::DavSslUiProxy> &&proxy)
Set an implementation for the DavSslUiProxy interface.
If none has been positioned, any SSL error will be automatically rejected and fail the corresponding job. Position one to avoid this behavior or be able to ask the user what to do.