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

QTcpSocket connection fails, when a system proxy is set but deactivated in Qt

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.9.2
    • 5.9.0
    • Network
    • None
    • Windows 7
    • d0c5e294323c69ef16c44466c3cff8decf4face5

      When a proy is configured in Windows and should not be used by Qt:

      QNetworkProxyFactory::setUseSystemConfiguration (false);

      QTcpSocket fails to connect.

      The problem is that in qnativesocketengine.cpp line 398 the system proxy is queried, regardless if the system configuration should be used:

              proxy = QNetworkProxyFactory::systemProxyForQuery(query).constFirst();
      

      To make it work in Qt 5.9.0 I have to set the QNetworkProxy::NoProxy for every QTcpSocket:

          tcpSocket = new QTcpSocket(this);
          tcpSocket->setProxy(QNetworkProxy::NoProxy);    // new line inserted!
      

      Seems to be triggered by patch

      https://codereview.qt-project.org/#/c/186124/

       

       

       

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

            andysh Andy Shaw
            s.fritsch Sebastian Fritsch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes