[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can WebView ignore SSL Certificate errors?


On 5/6/25 3:07 PM, Lee wrote:
I am loading a website in a WebView that always causes SSL handshake errors and somewhat randomly a SSL Certificate error. I suspect the Certificate error is due to a randomly displayed advertisement on the target website as its domain name is different. This is a sample of the errors including the random Certificate error:

[snip]

The website eventually loads, but it can take over 60 seconds to do it.

I am certain that I could not inherit WebView and get at its internals with Gambas code. But if I am wrong, I like to know.

Would it be a complex task to add a "Ignore Certificate Errors" flag to WebSettings?


I have discovered that the painfully slow load was not caused by the SSL handshake or the SSL certificate errors. It was caused by how I implemented the WebView.

The WebView was not a control on a form, but dynamically created and not displayed. The target page, at times, would load a full-screen overly advertisement. The code that displayed that ad apparently couldn't handle a viewport with a size of 0x0 and would block loading of the page.

I solved the issue by creating the New WebView, immediately Hiding it, and then giving it some reasonable dimensions. The page can still take 10 - 15 seconds to load, but that is acceptable for my use-case.


On a side note if anyone cares: during my research, I found out that QtWebEngine does not yet support extensions:
https://wiki.qt.io/QtWebEngine/ScriptsAndExtensions

Although that feature does appear to be in the works:
https://codereview.qt-project.org/c/qt/qtwebengine/+/601275
https://bugreports.qt.io/browse/QTBUG-61676


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


References:
Can WebView ignore SSL Certificate errors?Lee <t.lee.davidson@xxxxxxxxx>