Qt (at least with the OpenSSL backend) can be compiled:
- with no SSL support --
QT_NO_SSL
defined, SSL classes not even available for compilation;
- with SSL support loaded at runtime => OpenSSL headers must be present at compile time, but QtNetwork won't link to
libssl
/libcrypto
/...; instead, it will dlopen
those libraries at runtime looking for the functions it needs;
- with SSL support linked from QtNetwork.
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).