简体   繁体   中英

getting openSSL to work with Qt on mac

I am making some api calls to google maps some of which need to be encrypted so i'm using https. Whenever I make a request using https I get the errors:

qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_client_callback
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
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_get0_next_proto_negotiated

I get these errors also when using http but I will still recieve the data I want whereas with https I don't. I see that this is apparently because I do not have openSSL installed, so I checked and I had version 0.9.8, so I installed a newer version (1.0.2) (Note i'm on mac) but still have the same problem. I have seen a lot of similar questions but there either wasn't a solution, or if there was one it didn't work for me or I didn't understand what to actually do.

I ran the following code:

     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();

and received the output:

qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_client_callback
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
Support SSL:   true 
Lib Version Number:  9470431 
Lib Version String:  "OpenSSL 0.9.8zg 14 July 2015" 
Lib Build Version Number:  268439727 
Lib Build Version String:  "OpenSSL 1.0.1j 15 Oct 2014"

the versions listed don't refer to the one I recently installed so could the problem be its not using the new version?

If anyone knows how to fix this so I can use https without errors please give specific instructions because i'm not very experienced.

Thanks

The SSL warnings aren't fatal; secure connections should continue to work. According to this closed bug report you can suppress these messages by setting the following environment variable:

QT_LOGGING_RULES=qt.network.ssl.warning=false

Also, I'm fairly certain these warning messages (or very similar messages) appear on platforms other than OS X.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM