Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
SslHandshakeFailedError on iOS Qt5.5-alpha
che1404 last edited by che1404
I'm getting these network and ssl errors when I try to get a reply to a SSL request (like for example https://www.google.com):
SSL Error: "The issuer certificate of a locally looked up certificate could not be found"
Network error: QNetworkReply::NetworkError(SslHandshakeFailedError)
When I invoke the same request without the https, but with http only, then I get the expected result.
I'm using Qt5.5-alpha for iOS configured with the following switches:
./configure -v -prefix /Users/ro/lib/QT/Qt5.5-alpha-ios-ssl -xplatform macx-ios-clang -debug-and-release -opensource -confirm-license -static -nomake tests -nomake examples -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples -openssl-linked -I/Users/ro/lib/OPENSSL/OpenSSL-git/include -L/Users/ro/lib/OPENSSL/OpenSSL-git/lib -lcrypto -lssl
The configure script report tells me that SSL is present:
OpenSSL .............. yes (linked to the libraries)
And the OpenSSL version I'm using is this one, https://github.com/x2on/OpenSSL-for-iPhone, based on OpenSSL 1.0.2a.
My code is like this:
int main(int argc, char *argv)
QGuiApplication app(argc, argv);
QNetworkAccessManager qnam; QNetworkRequest request; request.setUrl(QUrl("https://www.google.es")); QNetworkReply* reply = qnam.get(request); Controller* controller = new Controller(reply); QObject::connect(reply, SIGNAL(finished()), controller , SLOT(replyReady())); QObject::connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), controller, SLOT(slotError(QNetworkReply::NetworkError))); QObject::connect(reply, SIGNAL(sslErrors(QList<QSslError>)), controller, SLOT(slotSslErrors(QList<QSslError>))); return app.exec();
The iOS version of my device is 8.2. The error happens both on the device and the simulator.
So, any ideas?
Thanks in advance,
Might be a silly question but is your OpenSSL library deployed with your application ? Or did you build it statically ?