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

Cannot distinguish SOCKS5 authentication failure from other connection errors, causing QNetworkAccessManager to cache incorrect password

    XMLWordPrintable

Details

    Description

      When socks5 proxy is used, we follow the procedure for TCP clients as given in RFC1928.
      The authentication is performed according to RFC1929.

      The server has a chance to deny the connection at this point, which would work correctly in Qt (re-emits the proxyAuthenticationRequired signal from the socket)
      However the dante socks implementation accepts all connections, and decides to accept/reject based on rules.

      • I assume this is so it can have different rules for authenticated vs non-authenticated clients.

      What we receive in the socks socket engine is an "X'02' connection not allowed by ruleset" response when attempting to set up the TCP connection.
      This would also be returned if we gave the correct username/password, but the connection is not whitelisted
      And also it is returned if we connect to a hostname, but the proxy could not look up the name.

      The socket engine assumes the final case ocurred, which results in HostNotFoundError being returned as the socket error.
      QNetworkAccessManager caches the incorrect credentials in this case, and will not prompt again.

      When using SOCKS proxy, it should cache credentials after a successful connection was established through the proxy.

      Attachments

        Issue Links

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

          Activity

            People

              shkearns Shane Kearns
              shkearns Shane Kearns
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes