Proper deployment of Qt app (requiring SSL) on MacOS
-
AFAIK, you shouldn't need to do anything special. Which version of macOS are you seeing that on ?
-
@SGaist I'm using macOS High Sierra in both computer. On my developpement Mac, Qt seems to recognize SecureTransport using qDebug() << QSslSocket::sslLibraryVersionString(); and same on the my testing Mac.
But it seems that the Https request works on first one and not the second one for a specific reason I can't get...
Okay I will try to have another look on this next days...Do you have some advices on debugging steps? Like using qDebug() << QSslSocket::sslLibraryVersionString(), to understand wich part on a request can end with trouble?
Thanks
-
You should use a tool like wireshark to compare the network activity between the two.
Are you connecting to a server which has a custom certificate ?
-
@Romain-C said in Proper deployment of Qt app (requiring SSL) on MacOS:
About the certificate, it was bought on namecheap (domain name, certificate and hosting). I mean is not something homemade generate !
Did you try to access your server from the other machine directly just to see if you get an error ?
-
@SGaist What do you mean by a direct access? If you mean using a web browser, it work great!
I wanted to see using wireshark if can see anything but as I'm using Https, data are encoded... =/
I also move to Qt 6.1.2 to see if anything was related to 5.12, but no changes in the behaviour.
However, in case of I missed something, I'm doing following instructions :
// Does SSL is supported
if(!QSslSocket::supportsSsl())
return;QString uniqueId = settings.value(keyValue(UniqueIdentifier), UNIQUE_IDENTIFIER_VALUE).toString(); if(uniqueId.isEmpty()) return; // Construct request QNetworkRequest request(QUrl("https://[website]")); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); // Construct data QByteArray data; data.append(QString("id="+uniqueId).toUtf8()); // Send request QNetworkReply *netReply = anonymousRequests->post(request, data);
-
I do not see any error handling here, did you just not post them ?
-
@Romain-C it is really odd - however I didn't do much work on High Sierra (it is very outdated). On Catalina and BigSur SSL support works out-of-the-box though.
Are you able to examine server side logs by any chance? This could help you to check if any connection is being made...With regards to errors you should examine if QNetworkManager::SslErrors() signal is being emitted (simply connect to it) (I assume
anonymousRequests
is of type QNAM)