mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Validate the providers ssl certificate
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
This commit is contained in:
parent
6ff3d67f61
commit
74d07e28cf
1 changed files with 2 additions and 10 deletions
|
@ -52,9 +52,6 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool certificateError(const QWebEngineCertificateError &certificateError) override;
|
bool certificateError(const QWebEngineCertificateError &certificateError) override;
|
||||||
|
|
||||||
private:
|
|
||||||
QUrl _rootUrl;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// We need a separate class here, since we cannot simply return the same WebEnginePage object
|
// We need a separate class here, since we cannot simply return the same WebEnginePage object
|
||||||
|
@ -191,15 +188,10 @@ QWebEnginePage * WebEnginePage::createWindow(QWebEnginePage::WebWindowType type)
|
||||||
|
|
||||||
void WebEnginePage::setUrl(const QUrl &url) {
|
void WebEnginePage::setUrl(const QUrl &url) {
|
||||||
QWebEnginePage::setUrl(url);
|
QWebEnginePage::setUrl(url);
|
||||||
_rootUrl = url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebEnginePage::certificateError(const QWebEngineCertificateError &certificateError) {
|
bool WebEnginePage::certificateError(const QWebEngineCertificateError &certificateError)
|
||||||
if (certificateError.error() == QWebEngineCertificateError::CertificateAuthorityInvalid &&
|
{
|
||||||
certificateError.url().host() == _rootUrl.host()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO properly improve this.
|
* TODO properly improve this.
|
||||||
* The certificate should be displayed.
|
* The certificate should be displayed.
|
||||||
|
|
Loading…
Reference in a new issue