Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57073

QNetworkProxyFactory::systemProxyForQuery sometimes fails to get proxy on VPN change.



    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.6.0, 5.7.0
    • Fix Version/s: None
    • Component/s: Network: Proxies
    • Labels:
    • Environment:
      Windows 7 64bit


      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.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            • Assignee:
              cnn Qt Core & Network
              chrisog Chris O'Gorman
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes