I am building an app with QT using SSL. When I compile the app with the QT SDK (dynamic linking), the app throws the following three errors:
QSslError::UnableToGetLocalIssuerCertificate
QSslError::UnableToVerifyFirstCertificate
QSslError::CertificateUntrusted
I handle these errors with the following code:
QSslError error0(QSslError::UnableToGetLocalIssuerCertificate, cert.at(0));
expectedSslErrors.append(error0);
QSslError error1(QSslError::UnableToVerifyFirstCertificate, cert.at(0));
expectedSslErrors.append(error1);
QSslError error2(QSslError::CertificateUntrusted, cert.at(0));
expectedSslErrors.append(error2);
this->socket->ignoreSslErrors(expectedSslErrors);
With dynamic linking, everything is fine. But when I compile this code using a Statically compiled QT, I get QSslError::NoError thrown thrice.
This happens on both Mac and Windows development environments.
I was compiling Qt with
-universaloption, to generate libraries for both i386 and ppc architectures, but the OpenSSL that I was compiling it with, was built for x64_86 arch. I built OpenSSL statically for both i386 and ppc, and then compiled Qt and everything is fine now.