From 62dd1f51770efa6ff46ff5b040fe92c911e3bd98 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 5 Mar 2017 19:57:06 +0900 Subject: [PATCH] src: OpenSSL 1.1.0 does not require explicit initialization --- src/ssl.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ssl.cc b/src/ssl.cc index 5425cb8e..5c6de55a 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -152,15 +152,17 @@ bool check_http2_requirement(SSL *ssl) { } void libssl_init() { -// OPENSSL_config() is not available in BoringSSL. It is also -// deprecated as of OpenSSL 1.1.0. -#if !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1_1_API +#if OPENSSL_1_1_API +// No explicit initialization is required. +#else // !OPENSSL_1_1_API +// OPENSSL_config() is not available in BoringSSL. +#if !defined(OPENSSL_IS_BORINGSSL) OPENSSL_config(nullptr); -#endif // !defined(OPENSSL_IS_BORINGSSL) && !OPENSSL_1_1_API - +#endif // !defined(OPENSSL_IS_BORINGSSL) SSL_load_error_strings(); SSL_library_init(); OpenSSL_add_all_algorithms(); +#endif // !OPENSSL_1_1_API } int ssl_ctx_set_proto_versions(SSL_CTX *ssl_ctx, int min, int max) {