Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.6.0, 5.7.0
-
None
-
Windows 7 64bit
Description
When a user is moving from a NoProxy connection to a VPN HttpProxy connection, QNetworkProxyFactory sometimes fails to get the proxy for the requested url.
The problume is that QWindowsSystemProxy is using the Windows registry for it's proxy detection.
When a user connects by VPN the proxySettingsWatcher detects the proxy change before the VPN client is fully finished connecting.
Then when the QNetworkProxyFactory attempts to download the PAC file by the WinHTTP API "WinHttpGetProxyForUrl" it fails with the error "ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT".
When that error happens isAutoConfig is then set to false, so now when the VPN client is finished connecting to the users network, QNetworkProxyFactory doesn't attempt to download the PAC file again.
As a result of this QNetworkProxyFactory::systemProxyForQuery will always return NoProxy for the requested url and the client will not connect to the endpoint unless QWindowsSystemProxy detects another registry change.
As the QNetworkProxyFactory is relying on the registry for it's proxy detection, it currently can’t tell the difference between a DIRECT connection and a HttpProxy connection where we failed first time to download the PAC file for the proxy address.
A possible fix for our issue would be to add an option to turn off the QT proxy caching and the registry detection check, where systemProxyForQuery would always return the current proxy from the OS.