]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
m4: Add SSL_CTX_set_min_proto_version detection
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Tue, 7 Nov 2017 12:47:01 +0000 (14:47 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 11 Dec 2017 07:30:07 +0000 (09:30 +0200)
m4/ssl.m4

index ef8a31132797d332f000b6fb327b0fecd886804c..e1716f67b8b8d40f6bcbed502479ac8f90aca968 100644 (file)
--- a/m4/ssl.m4
+++ b/m4/ssl.m4
@@ -114,6 +114,25 @@ AC_DEFUN([DOVECOT_SSL], [
         AC_DEFINE(HAVE_SSL_CTX_SET1_CURVES_LIST,, [Define if you have SSL_CTX_set1_curves_list])
       fi
 
+      # SSL_CTX_set_min_proto_version is also a macro so AC_CHECK_LIB fails here.
+      AC_CACHE_CHECK([whether SSL_CTX_set_min_proto_version exists],i_cv_have_ssl_ctx_set_min_proto_version,[
+        old_LIBS=$LIBS
+        LIBS="$LIBS -lssl"
+        AC_TRY_LINK([
+          #include <openssl/ssl.h>
+        ], [
+          SSL_CTX_set_min_proto_version((void*)0, 0);
+        ], [
+          i_cv_have_ssl_ctx_set_min_proto_version=yes
+        ], [
+          i_cv_have_ssl_ctx_set_min_proto_version=no
+        ])
+        LIBS=$old_LIBS
+      ])
+      if test $i_cv_have_ssl_ctx_set_min_proto_version = yes; then
+        AC_DEFINE(HAVE_SSL_CTX_SET_MIN_PROTO_VERSION,, [Define if you have SSL_CTX_set_min_proto_version])
+      fi
+
       AC_CHECK_LIB(ssl, ERR_remove_thread_state, [
         AC_DEFINE(HAVE_OPENSSL_ERR_REMOVE_THREAD_STATE,, [Define if you have ERR_remove_thread_state])
       ],, $SSL_LIBS)