There is a define QT_NO_SSL
, that is defined if there was no Ssl library found.
There also is the method QSslSocket::supportsSsl()
.
But how are these two related, are they equivalent?
Does QT_NO_SSL <=> QSslSocket::supportsSsl() returns false
hold or is it possible that QT_NO_SSL
is not defined, but QSslSocket::supportsSsl()
returns false?
Qt (at least with the OpenSSL backend) can be compiled:
QT_NO_SSL
defined, SSL classes not even available for compilation;libssl
/libcrypto
/...; instead, it will dlopen
those libraries at runtime looking for the functions it needs;The reason for this has to do with the fact that linking QtNetwork to a cryptographic library opens legal problems in terms of redistribution from/to the US. With #3 you must have the SSL libraries around or your application won't start, even if you don't need SSL at all; and Qt installers can't "easily" ship those SSL libraries. So instead Qt gets compiled in configuration #2 and you have the responsability of installing OpenSSL.
The scenario in which QT_NO_SSL
is not defined but QSslSocket::supportsSsl()
returns false is #2 (for instance if Qt fails to find or load a suitable SSL library).