PDA

View Full Version : Using a proxy built into the application to access https headers in QtWebEngine



StCrocco
10th April 2020, 19:56
Hello to everyone,
I'm the maintainer of the Konqueror web browser for Linux (https://kde.org/applications/internet/org.kde.konqueror) and I'm trying to port it from QtWebKit to QtWebEngine, working around its many limitations.

One of the biggest problems is that Konqueror needs to manage the network requests and responses by itself (or rather, have it managed by the underlying KDE libraries), which isn't allowed by QtWebEngine.

The only idea that came to my mind is to write an http proxy and integrate it in Konqueror, then make QtWebEngine use it. This way, Konqueror would be able to see the response headers before they reach QtWebEngine and do whatever it needs with them.

While this works correctly with HTTP URLs it doesn't work with HTTPS because, of course, the proxy only sees the encrypted headers. I'm wondering whether it would be possible for Konqueror to create an SSL certificate and use it to encrypt the communication with QtWebEngine. What I'd hope to do would be something like this:
-
QtWebEngine sends the request to the proxy within Konqueror, encrypted using the key provided by Konqueror itself
Konqueror decrypts the request and sends it to the the server as usual
Konqueror receives the response from the server and analyzes it
Konqueror encrypts the response with its own certificate and sends it to QtWebEngine.


Unfortunately, QtWebEngine doesn't provide a way to tell it that the certificate provided by Konqueror must be trusted (of course, that certificate can't be installed system-wide). It does have a function which is called in case of a certificate error and which allows to ignore the error. However, my attempts so far have been unsuccessful.

Is what I'm hoping to achieve really impossible or am I doing something wrong?

Thanks in advance

AndrewJZA
24th May 2021, 20:41
You can't do it, man.

Wanda1YN
24th May 2021, 21:45
Try to find info about this on Google

Wanda1YN
30th May 2021, 22:15
Try to find info about this on Google

It seems to me that a similar problem occurs on Linux. Basically, everyone who uses proxy servers, they do it on Windows, because there will be fewer problems. By the way, you should review your config, because there are probably errors there. So try to search the Internet for a detailed guide on configuring proxy servers, I think this will help you. And yet, even if you work on Linux, try to set up the servers first on Google Chrome, and not on Konqueror, because it's much easier, as it seems to me.

d_stranz
31st May 2021, 16:09
@Wanda1YN: Please do not post links to commercial web sites. I do not think you understand the question the the OP posted. He is not looking to set up a proxy server, and posting a link to a site providing commercial proxy services is not an appropriate answer.