X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=autoconf%2Fpecl%2Flibcurl.m4;h=8de9499e0eaef8351c9a397a1a9e2051f66ee008;hp=fce643748743911517316e35f8d6e790c33864c0;hb=HEAD;hpb=cb4b67381dd7bc1f9c8bc1c65729ed0e694512ae diff --git a/autoconf/pecl/libcurl.m4 b/autoconf/pecl/libcurl.m4 index fce6437..fd0e711 100644 --- a/autoconf/pecl/libcurl.m4 +++ b/autoconf/pecl/libcurl.m4 @@ -7,7 +7,7 @@ dnl AC_DEFUN([PECL_HAVE_LIBCURL_FEATURE], [dnl AC_REQUIRE([PECL_PROG_EGREP])dnl AC_CACHE_CHECK([for $1 feature in libcurl], PECL_CACHE_VAR([HAVE_LIBCURL_FEATURE_$1]), [ - if $CURL_CONFIG --feature | $EGREP -q $1; then + if $CURL_CONFIG --feature | $EGREP -qi $1; then PECL_CACHE_VAR([HAVE_LIBCURL_FEATURE_$1])=yes else PECL_CACHE_VAR([HAVE_LIBCURL_FEATURE_$1])=no @@ -126,40 +126,66 @@ AC_DEFUN([PECL_HAVE_LIBCURL_SSL], [dnl ;; esac - PECL_HAVE_CONST([curl/curl.h], [CURLOPT_TLSAUTH_TYPE], int, [ - AC_CACHE_CHECK([whether CURLOPT_TLSAUTH_TYPE expects CURL_TLSAUTH_SRP], PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP]), [ - PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP])= + PECL_HAVE_CONST([curl/curl.h], [CURL_VERSION_TLSAUTH_SRP], int, [ + AC_CACHE_CHECK([for CURLOPT_TLSAUTH_TYPE SRP support], PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP]), [ + PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP])=no AC_TRY_RUN([ #include int main(int argc, char *argv[]) { - CURL *ch = curl_easy_init(); - return curl_easy_setopt(ch, CURLOPT_TLSAUTH_TYPE, CURL_TLSAUTH_SRP); + int has_feature = curl_version_info(CURLVERSION_NOW)->features & CURL_VERSION_TLSAUTH_SRP; + int set_failure = curl_easy_setopt(curl_easy_init(), CURLOPT_TLSAUTH_TYPE, "SRP"); + return !has_feature || set_failure; } ], [ PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP])=yes + ]) + ]) + if test "$PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP])" = "yes"; then + PECL_DEFINE([HAVE_LIBCURL_TLSAUTH_TYPE]) + fi + ]) + + PECL_HAVE_CONST([curl/curl.h], [CURL_LOCK_DATA_SSL_SESSION], int, [ + AC_CACHE_CHECK([whether curl_share accepts CURL_LOCK_DATA_SSL_SESSION], PECL_CACHE_VAR([LIBCURL_SHARE_SSL]), [ + PECL_CACHE_VAR([LIBCURL_SHARE_SSL])= + AC_TRY_RUN([ + #include + int main(int argc, char *argv[]) { + CURLSH *ch = curl_share_init(); + return curl_share_setopt(ch, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); + } + ], [ + PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=yes ], [ + PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=no + ]) + ]) + if test "$PECL_CACHE_VAR([LIBCURL_SHARE_SSL])" = yes; then + PECL_DEFINE([HAVE_LIBCURL_SHARE_SSL], [1]) + fi + ]) + + if test "$PECL_VAR([LIBCURL_SSLLIB])" == "OpenSSL"; then + PECL_HAVE_CONST([curl/curl.h], [CURLOPT_TLS13_CIPHERS], int, [ + AC_CACHE_CHECK([whether curl_easy_setopt accepts CURLOPT_TLS13_CIPHERS], PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS]), [ + PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])= AC_TRY_RUN([ #include int main(int argc, char *argv[]) { CURL *ch = curl_easy_init(); - return curl_easy_setopt(ch, CURLOPT_TLSAUTH_TYPE, "SRP"); + return curl_easy_setopt(ch, CURLSHOPT_TLS13_CIPHERS, ""); } ], [ - PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP])=no + PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])=yes + ], [ + PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])=no ]) ]) - ]) - if test -n "$PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP])"; then - PECL_DEFINE([HAVE_LIBCURL_TLSAUTH_TYPE]) - if $PECL_CACHE_VAR([LIBCURL_TLSAUTH_SRP]); then - PECL_DEFINE([LIBCURL_TLSAUTH_SRP], [CURL_TLSAUTH_SRP]) - PECL_DEFINE([LIBCURL_TLSAUTH_DEF], [CURL_TLSAUTH_NONE]) - else - PECL_DEFINE([LIBCURL_TLSAUTH_SRP], ["SRP"]) - PECL_DEFINE([LIBCURL_TLSAUTH_DEF], [""]) + if test "$PECL_CACHE_VAR([LIBCURL_TLS13_CIPHERS])" = yes; then + PECL_DEFINE([HAVE_LIBCURL_TLS13_CIPHERS], [1]) fi - fi - ]) + ]) + fi ]) ]) dnl @@ -225,4 +251,4 @@ AC_DEFUN([PECL_CHECK_LIBCURL], [dnl ifelse([$2],,,[ PECL_HAVE_VERSION([libcurl], [$2]) ]) -]) \ No newline at end of file +])