commit 5fe37b899b0f62e7a6281f34b7921be007e289e2
parent c196047666c45da71db68f9beebbf605c2d47544
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 7 Apr 2014 20:50:28 +0000
Fix curl HTTPS test with GnuTLS specific version
Diffstat:
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -538,6 +538,7 @@ GNUTLS_CFLAGS=""
GNUTLS_LDFLAGS=""
GNUTLS_LIBS=""
have_gnutls=no
+have_gnutls_sni=no
AC_MSG_CHECKING(for gnutls)
AC_ARG_WITH(gnutls,
[AC_HELP_STRING([--with-gnutls=PFX],[base of gnutls installation])],
@@ -549,6 +550,7 @@ AC_ARG_WITH(gnutls,
AC_CHECK_HEADERS([gnutls/gnutls.h],
[AC_CHECK_LIB([gnutls], [gnutls_priority_set], [
GNUTLS_LIBS="-lgnutls"
+ AC_CHECK_LIB([gnutls], [gnutls_load_file], [AC_CHECK_LIB([gnutls], [gnutls_privkey_import_x509_raw], [have_gnutls_sni=yes])])
have_gnutls=yes])])
;;
*)
@@ -563,6 +565,7 @@ AC_ARG_WITH(gnutls,
GNUTLS_CPPFLAGS="-I$with_gnutls/include"
GNUTLS_LDFLAGS="-L$with_gnutls/lib"
GNUTLS_LIBS="-lgnutls"
+ AC_CHECK_LIB([gnutls], [gnutls_load_file], [AC_CHECK_LIB([gnutls], [gnutls_privkey_import_x509_raw], [have_gnutls_sni=yes])])
have_gnutls=yes
])])])
AS_IF([test "x$have_gnutls" != "xyes"], [AC_MSG_ERROR([can't find usable libgnutls at specified prefix $with_gnutls])])
@@ -576,9 +579,11 @@ AC_ARG_WITH(gnutls,
[AC_CHECK_LIB([gnutls], [gnutls_priority_set],
[
GNUTLS_LIBS="-lgnutls"
+ AC_CHECK_LIB([gnutls], [gnutls_load_file], [AC_CHECK_LIB([gnutls], [gnutls_privkey_import_x509_raw], [have_gnutls_sni=yes])])
have_gnutls=yes
])])])
AM_CONDITIONAL(HAVE_GNUTLS, test "x$have_gnutls" = "xyes")
+AM_CONDITIONAL([HAVE_GNUTLS_SNI], [test "x$have_gnutls_sni" = "xyes"])
AC_SUBST([GNUTLS_CPPFLAGS])
AC_SUBST([GNUTLS_LDFLAGS])
diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am
@@ -4,6 +4,10 @@ if USE_COVERAGE
AM_CFLAGS = --coverage
endif
+if HAVE_GNUTLS_SNI
+ TEST_HTTPS_SNI = test_https_sni
+endif
+
CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT)
AM_CPPFLAGS = \
@@ -17,7 +21,7 @@ check_PROGRAMS = \
test_tls_authentication \
test_https_multi_daemon \
test_https_get \
- test_https_sni \
+ $(TEST_HTTPS_SNI) \
test_https_get_select \
test_https_get_parallel \
test_https_get_parallel_threads \
@@ -32,7 +36,7 @@ TESTS = \
test_tls_options \
test_https_multi_daemon \
test_https_get \
- test_https_sni \
+ $(TEST_HTTPS_SNI) \
test_https_get_select \
test_https_get_parallel \
test_https_get_parallel_threads \
@@ -122,6 +126,7 @@ test_https_get_LDADD = \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
$(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
+if HAVE_GNUTLS_SNI
test_https_sni_SOURCES = \
test_https_sni.c \
tls_test_common.c
@@ -132,6 +137,7 @@ test_https_sni_LDADD = \
$(top_builddir)/src/testcurl/libcurl_version_check.a \
$(top_builddir)/src/microhttpd/libmicrohttpd.la \
$(GNUTLS_LDFLAGS) $(GNUTLS_LIBS) @LIBGCRYPT_LIBS@ @LIBCURL@
+endif
test_https_get_select_SOURCES = \
test_https_get_select.c \