Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem with OpenSSL on Mac OS X Yosemite



  • Hello,

    I try to fetch information from https://maps.googleapis.com/maps/api/geocode/json?sensor=false&key=[my_key]&address=... within QML. I use the standard XMLHttpRequest.

    Qt 5.4.2 with QtCreator 3.4.1 on Mac OS X 10.10.3 Yosemite (64 bit) building with Clang 6.0

    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function () {
        console.log(xhr.readyState);
        if (xhr.readyState === 4) {
            console.log(xhr.status, xhr.statusText);
            if (xhr.status === 200) {
                console.log(xhr.responseText);
            } else {
                console.log("service unavaible");
            }
        }
    }
    xhr.open("GET", , true);
    xhr.send("https://maps.googleapis.com/maps/api/geocode/json?sensor=false&key=[my_key]&address=Google");
    

    I get the following output:

    qml: 1
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
    qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
    qml: 4
    qml: 4 0 
    qml: service unavaiable
    

    If I change the protocol to HTTP I get:

    qml: 1
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
    qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
    qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
    qml: 2
    qml: 3
    qml: 4
    qml: 200 OK
    qml: Requests to this API must be over SSL.
    

    If I then remove the key parameter it works, but obviously that's not an option.
    Is this because Qt uses a deprecated OpenSSL lib?
    If I check the SSL version with ...

    qDebug() << "Support SSL:  " << QSslSocket::supportsSsl()
                << "\nLib Version Number: " << QSslSocket::sslLibraryVersionNumber()
                << "\nLib Version String: " << QSslSocket::sslLibraryVersionString()
                << "\nLib Build Version Number: " << QSslSocket::sslLibraryBuildVersionNumber()
                << "\nLib Build Version String: " << QSslSocket::sslLibraryBuildVersionString();
    

    ... the following is returned:

    Lib Version Number:  9470431 
    Lib Version String:  "OpenSSL 0.9.8zd 8 Jan 2015" 
    Lib Build Version Number:  268439727 
    Lib Build Version String:  "OpenSSL 1.0.1j 15 Oct 2014"
    


  • Hi @dontdoeval !

    I'm working with Google AdWords API and I'm dealing with same situation as you posted here.
    The only different is I'm even can't get WebView load a simple https page like https://google.com

    I wondering did you find your answer? do you have any ideal how to get it work?

    Thanks a lot !!!


  • Lifetime Qt Champion

    Hi,

    One alternative to consider is to rebuild Qt using the new Secure Transport backend for OS X.