]> granicus.if.org Git - curl/commitdiff
gnutls: check for alpn and ocsp in configure
authorMarcus Hoffmann <m.hoffmann@cartelsol.com>
Wed, 11 Jan 2017 13:42:41 +0000 (14:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 13 Jan 2017 08:54:55 +0000 (09:54 +0100)
Check for presence of gnutls_alpn_* and gnutls_ocsp_* functions during
configure instead of relying on the version number.  GnuTLS has options
to turn these features off and we ca just work with with such builds
like we work with older versions.

Signed-off-by: Marcus Hoffmann <m.hoffmann@cartelsol.com>
Closes #1204

configure.ac
lib/vtls/gtls.c

index 65dac55bc076e9e9ed1b301026b55b1e0d132b9f..fa44787ef8a76666c1b4ce2b2d5d662e86df2552 100644 (file)
@@ -1847,7 +1847,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
             AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
           fi
         fi
-        AC_CHECK_FUNCS(gnutls_certificate_set_x509_key_file2)
+        AC_CHECK_FUNCS([gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init])
       fi
 
     fi
index 2b539380d79b9aeee7a53e578885af8b18e32ccf..a992f999477b2f3e9f435a5cabb6e667c0520a63 100644 (file)
@@ -92,11 +92,11 @@ static bool gtls_inited = FALSE;
 #    define GNUTLS_MAPS_WINSOCK_ERRORS 1
 #  endif
 
-#  if (GNUTLS_VERSION_NUMBER >= 0x030200)
+#  if HAVE_GNUTLS_ALPN_SET_PROTOCOLS
 #    define HAS_ALPN
 #  endif
 
-#  if (GNUTLS_VERSION_NUMBER >= 0x03020d)
+#  if HAVE_GNUTLS_OCSP_REQ_INIT
 #    define HAS_OCSP
 #  endif