iOS + SSL seems to work but sometimes errors occur
my app (iOS 9.x) connects to my server (Ubuntu 15.10 64bit).
Both are written in Qt and they communicate over QSslSocket.
On Desktop it works perfect.
Running the app on the real device the QSslSocket (device side) sometimes emits error(QAbstractSocket::SocketError) with the following:
"SSLRead failed: -50"
The strange thing is that is that everything seems to work with this error.
Any ideas what this could be?
I have the exact same error with my app. Everything works correctly, except sometimes on a real iOS device i get that "SSLRead failed: -50" error...
And I'm not using QSslSocket directly, but QNetworkRequest with https urls. And even if i do handle this error and try to read data, it does not return anything. The code qsslsocket code stops the reading when any error occured:
If this error happens the only way is to do the https request again and hope it will not fail.
I also tried building a Qt using openssl instead of iOS SSL platform code, and i do not have the problem anymore...
Ah, and I'm using Qt 5.5.1
Apple doesn't ship OpenSSL for iOS so you would have to first build OpenSSL for iOS and re-build Qt to use. However, since Qt 5.5 there's also the Secure Transport backend that can be used as an alternative.