Unless being configured with the `no-deprecated` option, OpenSSL 3.0.0
still has the deprecated APIs present and will throw warnings during
compilation, when using them.
Make sure that the old APIs are being used only with the older versions
of OpenSSL.
REQUIRE(dhparams_file != NULL);
REQUIRE(*dhparams_file != '\0');
-#ifdef SSL_CTX_set_tmp_dh
+#if OPENSSL_VERSION_NUMBER < 0x30000000L
/* OpenSSL < 3.0 */
DH *dh = NULL;
FILE *paramfile;
DH_free(dh);
#else
- /* OpenSSL >= 3.0: SSL_CTX_set_tmp_dh() is deprecated in OpenSSL 3.0 */
+ /* OpenSSL >= 3.0: low level DH APIs are deprecated in OpenSSL 3.0 */
EVP_PKEY *dh = NULL;
BIO *bio = NULL;
* SSL context at this point. */
BIO_free(bio);
-#endif
+#endif /* OPENSSL_VERSION_NUMBER < 0x30000000L */
return (true);
}