qsslSocketCannotResolveSymbolWarning being thrown in Qt 5.5.1 but not in Qt 5.2.1



  • I am porting my application from Qt 5.2.1 to Qt 5.5.1 in order to support for Windows 10. However there is a new qWarning() being thrown on calls to QNetworkAccessManager::get(), even though the requests are correct.
    Please note that I am making http requests and not https.
    Also, it was running fine without any issues in Qt 5.2.1, but is throwing this warning after running with the latest Qt (same as SDK, not modified anything).
    Here are some details of some of the warnings:

    QSslSocket: cannot resolve TLSv1_1_client_method
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    
    
    QSslSocket: cannot resolve TLSv1_2_client_method
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    
    QSslSocket: cannot resolve TLSv1_1_server_method
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    
    QSslSocket: cannot resolve TLSv1_2_server_method
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    
    QSslSocket: cannot resolve SSL_select_next_proto
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    
    
    QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    
    QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
    Category: qt.network.ssl
    File: ssl\qsslsocket_openssl_symbols.cpp
    Function: void {anonymous}::qsslSocketCannotResolveSymbolWarning(const char*)
    

    If it helps here is my implementation:

    void MyDownload::getRequest(const QString url)
    {
        if(progressBar)
        {
            connect(progressBar, SIGNAL(killDownloading()), this, SLOT(killDownload()));
            connect(this, SIGNAL(updateProgress(int,int,int)), progressBar, SLOT(updateProgress(int,int,int)));
            connect(this, SIGNAL(downloadComplete(int)), progressBar, SLOT(downloadComplete(int)));
            if(!progressBarID)
                progressBarID = progressBar->getID();
            else
                qWarning() << "ID: " << progressBarID << " already assigned for new request.";
        }
    
        connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(fileDownloaded(QNetworkReply*)));
        request.setUrl(QUrl(url));
        networkReply = manager.get(request);
        connect(networkReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(progress(qint64,qint64)));
        if(file)
            connect(networkReply, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
        finished = false;
        success = false;
        while(!finished)
        {
            QApplication::processEvents();
            ThreadSleep::mySleep(QThread::currentThread(), 50);
        }
    
        if(progressBar)
        {
            disconnect(progressBar, 0, this, 0);
            disconnect(this, 0, progressBar, 0);
        }
    }
    
    

    class variables in header file:

    private:
        QNetworkAccessManager manager;
        QNetworkRequest request;
        QNetworkReply *networkReply;
        QString *data;
        QFile *file;
        bool finished;
        bool success;
        QString errorMessage;
        MyProgressBar *progressBar;
        int progressBarID;
    

    What could possibly be going wrong, and how can I correct it?


  • Lifetime Qt Champion

    Hi,

    That's because you are using a version of OpenSSL that is different (usually more recent) than the one that was used to build Qt. So either use the same version or rebuild Qt to use your version of OpenSSL.



  • @SGaist
    Thank you for your reply!
    But I do not understand it.

    1. I am not making https requests, just http.
    2. I am not using openssl explicitly in my code.
    3. I do not want to use openssl at all (read an article about certain additional legal requirements, so won't be using it)

    I am using the Qt 5.5.1 build with same compiler that came with the SDK.
    So can you please tell me where I am using openssl, and how do I stop this warning from showing?
    Please forgive me but this is my first time with networking, so I may not know certain basic concepts..


  • Lifetime Qt Champion

    1. Your http request might be redirected to a https end point
    2. That doesn't matter, if you have a secured connection then it will be used
    3. Take the time to think twice about that. Would you use an application that sends or gets data over a network knowing that it doesn't provide any level of encryption ?

    How to stop the warnings:

    • option 1: use the same version used to build Qt
    • option 2: rebuild Qt with your current version of OpenSSL
    • option 3: rebuild Qt without any support for OpenSSL


  • @SGaist Thank you for your reply.

    I understand that using an encryption is necessary, but I saw on Qt's webpages that certain countries do not allow OpenSSL. Additionally it can only be used on open source applications. As my application is closed source, I do not want to run into any legal issues.

    1. option 1: I am using the same which is available for download from Qt website, I have not rebuilt Qt or any other thing. I am even using the same compiler from SDK.
    2. option 2: How do I know which version of OpenSSL I have? I have never installed it explicitly, only probability of that would be if it comes along with Qt. So it should be the same version by default right?
    3. option 3: I can do this, but is there a way to disable OpenSSL in my current version without having to rebuild it?

  • Lifetime Qt Champion

    1. Qt is built to load OpenSSL dynamically if available, it's not linked against it. Since as you notice there are restrictions for distributions.

    2. What OS are you running ? If OS X, it's already there although it's an old version. If Linux, then it's a library that's usually installed by default.

    3. No, you have to at least rebuild qtbase.



  • @SGaist I am using Windows 7. I think I will just rebuild Qt with OpenSSL disabled.
    Just a side note, I noticed that the MinGW version used for Qt 5.5.1 is an experimental version. If I use the stable version (lower version than the experimental) then Qt should build just fine right?



  • I just now found out the best solution for this problem.
    You don't need to rebuild Qt nor support OpenSSL.
    Just add the following line in main.cpp

    QLoggingCategory::setFilterRules("qt.network.ssl.warning=false");
    

  • Moderators

    @CAD_coding Why do you think it is experimental?



  • @jsulm I checked the MinGW builds on sourceforge and the Qt version is in the experimental secion, way ahead of the stable version which is more than a year older.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.