]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_ssl: follow up to r1861950: allow for OPENSSL_init_ssl() without autoconf.
authorYann Ylavic <ylavic@apache.org>
Fri, 21 Feb 2020 14:22:10 +0000 (14:22 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 21 Feb 2020 14:22:10 +0000 (14:22 +0000)
For systems with no autoconf (eg. Windows), still check for and use
OPENSSL_init_ssl() based on OpenSSL version >= 1.1.0.

Usual LibreSSL gotcha, exclude LIBRESSL_VERSION_NUMBER from this new heuristic
since autoconf is likely available in this case.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874323 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/mod_ssl.c
modules/ssl/ssl_private.h

index e61ec7e81eaf3fdb649ecac1d7633b30f91124a3..d5189341f102477fc382cb611669fd8e8da45290 100644 (file)
@@ -24,7 +24,6 @@
  *  Apache API interface structures
  */
 
-#include "ap_config_auto.h"
 #include "ssl_private.h"
 #include "mod_ssl.h"
 #include "mod_ssl_openssl.h"
@@ -335,9 +334,10 @@ static int modssl_is_prelinked(void)
 
 static apr_status_t ssl_cleanup_pre_config(void *data)
 {
-#if HAVE_OPENSSL_INIT_SSL
-    /* Openssl v1.1+ handles all termination automatically. Do
-     * nothing in this case.
+#if HAVE_OPENSSL_INIT_SSL || (OPENSSL_VERSION_NUMBER >= 0x10100000L && \
+                              !defined(LIBRESSL_VERSION_NUMBER))
+    /* Openssl v1.1+ handles all termination automatically from
+     * OPENSSL_init_ssl(). Do nothing in this case.
      */
 
 #else
@@ -404,7 +404,8 @@ static int ssl_hook_pre_config(apr_pool_t *pconf,
 #endif
     modssl_running_statically = modssl_is_prelinked();
 
-#if HAVE_OPENSSL_INIT_SSL
+#if HAVE_OPENSSL_INIT_SSL || (OPENSSL_VERSION_NUMBER >= 0x10100000L && \
+                              !defined(LIBRESSL_VERSION_NUMBER))
     /* Openssl v1.1+ handles all initialisation automatically, apart
      * from hints as to how we want to use the library.
      *
index a8b219c280ba1c35f4902755edf4612093753a77..4148647ac30779a713cc1e68f2efad276d3497a3 100644 (file)
@@ -27,6 +27,7 @@
  */
 
 /** Apache headers */
+#include "ap_config.h"
 #include "httpd.h"
 #include "http_config.h"
 #include "http_core.h"