]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that testcode dohclient has OpenSSL initialisation calls.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 Apr 2021 07:41:04 +0000 (09:41 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 22 Apr 2021 07:41:04 +0000 (09:41 +0200)
doc/Changelog
testcode/dohclient.c

index 793b40cf1098e8bb91486518a208bfedcf929308..85eb78c2a67dc1909ba6512849cff3d4f936b3db 100644 (file)
@@ -4,6 +4,7 @@
        - Fix #468: OpenSSL 1.0.1 can no longer build Unbound.
        - Further fix for #468: detect SSL_CTX_set_alpn_protos for build with
          OpenSSL 1.0.1.
+       - Fix that testcode dohclient has OpenSSL initialisation calls.
 
 13 April 2021: George
        - Fix documentation comment for files previously residing in checkconf/.
index b00bb15e02785b7e9286372ca4071310612b9c06..0dc039f263c12193f21e76f6cd355d14fa331633 100644 (file)
@@ -622,7 +622,25 @@ int main(int argc, char** argv)
                return 1;
        }
 
-
+       if(!no_tls) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL)
+               ERR_load_SSL_strings();
+#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_CRYPTO)
+#  ifndef S_SPLINT_S
+               OpenSSL_add_all_algorithms();
+#  endif
+#else
+               OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS
+                       | OPENSSL_INIT_ADD_ALL_DIGESTS
+                       | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000 || !defined(HAVE_OPENSSL_INIT_SSL)
+               (void)SSL_library_init();
+#else
+               (void)OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
+#endif
+       }
        run(h2_session, port, no_tls, argc, argv);
 
        checklock_stop();