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

QNetworkAccessManager does not propagate proxy errors properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • 6.5.3, 6.6.0 Beta2, 6.7.0 FF
    • 5.8.0, 5.11.0
    • Network, Network: Proxies
    • None
    • Windows 10, Qt 5.11.0 for MSVC2015 32-bit

      macOS 10.12, Qt 5.8.0
    • macOS
    • 69de333e1 (dev), 91132d6b2 (6.6), 2b59519bd (6.5)

      If a proxy server can't be contacten when using QNetworkAccessManager, the error code from the HTTP engine is not being returned properly through QNetworkReply. Instead the error code is set to QNetworkReply::UnknownNetworkError or just QNetworkReply::HostNotFoundError.

      I've configured an HTTP proxy with QNetworkProxy::setApplicationProxy.

      If the proxy server returns connection refused, then the error code from QNetworkReply::error() is UnknownNetworkError. The errorString() says "Proxy connection refused" though.

      If the proxy server does not exist then error() returns HostNotFoundError which implies that the end host is not found rather than the proxy server. errorString() even says "Host <...> is not found", referencing the end server rather than the proxy server.

       

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

            cnn Qt Core & Network
            hmoffatt Hamish Moffatt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes