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

QNetworkAccessManager isn't maintaining the SSL protocol set in QSslConfiguration set in QNetworkRequest

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • Some future release
    • 4.4.3
    • Network, Network: SSL
    • None
    • Microsoft Visual Studio 2005. Windows 7 64 bit. Virtual Machine (VMFusion on a power MAC).

    Description

      The server I'm trying to connect to is a TLS server, and cannot use SSLv3 (unauthorized). I'm using QNetworkAccessManager to make connections to the server, so I have to configure the QSslConfiguration object within the QNetworkRequest.

      {
        QNetworkAccessManager *manager = new QNetworkAccessManager(this);
        connect(manager, SIGNAL(finished(QNetworkReply*)),
                this, SLOT(replyFinished(QNetworkReply*)));
      
        QNetworkRequest networkRequest(QUrl("https://www.testtlsserver.com"));
        QSslConfiguration sslConfig = networkRequest.sslConfiguration();
        sslConfig.setProtocol(QSsl::TlsV1);
        networkRequest.setSslConfiguration(sslConfig);
      
        manager->get(networkRequest);
      }
      
      

      I have a current workaround for this issue, which is to set the default configuration using the static function QSslConfiguration::setDefaultConfiguration, but I should not have to use this; I should be able to apply a different ssl configuration towards unique network requests.

      The other problem is I get an "UnknownNetworkError" when I'm trying to connect to a server through an unsupported SSL protocol. After diving through Qt code, I found an error string in QIODevice reporting this; SSL3_GET_RECORD:wrong version number. This should be a valid error, or at least be recorded as a SslHandshakeFailedError. Also, the sslErrors() SIGNAL from QNetworkAccessManager should be able to pick up this error, but it does not. It should be able to pick it up, so then I could change the protocol to use in the QNetworkReply* so that the connection tries the handshake again with a different ssl configuration. That, or allow QSslConfiguration in the QNetworkRequest and/or QNetworkReply be able to use the QSsl::AnyProtocol object. That way, both protocols can be used and attempted.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            atemple Adam Temple
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes