diff --git a/GPClient/CMakeLists.txt b/GPClient/CMakeLists.txt index 94ffaac..4a172fa 100644 --- a/GPClient/CMakeLists.txt +++ b/GPClient/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(gpclient cdpcommand.cpp cdpcommandmanager.cpp enhancedwebview.cpp + enhancedwebpage.cpp gatewayauthenticator.cpp gatewayauthenticatorparams.cpp gpgateway.cpp diff --git a/GPClient/enhancedwebpage.cpp b/GPClient/enhancedwebpage.cpp new file mode 100644 index 0000000..67e8f50 --- /dev/null +++ b/GPClient/enhancedwebpage.cpp @@ -0,0 +1,9 @@ + +#include "enhancedwebpage.h" +#include +#include + +bool EnhancedWebPage::certificateError(const QWebEngineCertificateError &certificateError) { + LOGI << "An error occurred during certificate verification for" << certificateError.url() << "; " << certificateError.errorDescription(); + return certificateError.deferred(); +}; diff --git a/GPClient/enhancedwebpage.h b/GPClient/enhancedwebpage.h new file mode 100644 index 0000000..f043edc --- /dev/null +++ b/GPClient/enhancedwebpage.h @@ -0,0 +1,12 @@ +#ifndef ENHANCEDWEBPAGE_H +#define ENHANCEDWEBPAGE_H + +#include + +class EnhancedWebPage : public QWebEnginePage +{ +protected: + bool certificateError(const QWebEngineCertificateError &certificateError) override; +}; + +#endif // !ECHANCEDWEBPAG diff --git a/GPClient/enhancedwebview.cpp b/GPClient/enhancedwebview.cpp index 8415609..ea20be0 100644 --- a/GPClient/enhancedwebview.cpp +++ b/GPClient/enhancedwebview.cpp @@ -1,6 +1,7 @@ #include #include +#include "enhancedwebpage.h" #include "enhancedwebview.h" #include "cdpcommandmanager.h" @@ -14,6 +15,7 @@ EnhancedWebView::EnhancedWebView(QWidget *parent) void EnhancedWebView::initialize() { + setPage(new EnhancedWebPage()); auto port = QProcessEnvironment::systemEnvironment().value(ENV_CDP_PORT); cdp->initialize("http://127.0.0.1:" + port + "/json"); }