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

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

    XMLWordPrintable

Details

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

    Description

      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/

       

       

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-61692
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes