save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $CURL_LIBS"
- AC_MSG_CHECKING([for openssl support in libcurl])
+ AC_MSG_CHECKING([for libcurl linked against old openssl])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <strings.h>
#include <curl/curl.h>
const char *ptr = data->ssl_version;
while(*ptr == ' ') ++ptr;
- return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1);
+ if (strncasecmp(ptr, "OpenSSL/1.1", sizeof("OpenSSL/1.1")-1) == 0) {
+ /* New OpenSSL version */
+ return 3;
+ }
+ if (strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1) == 0) {
+ /* Old OpenSSL version */
+ return 0;
+ }
+ /* Different SSL library */
+ return 2;
}
+ /* No SSL support */
return 1;
}
]])],[
AC_MSG_RESULT([yes])
- AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
+ AC_DEFINE([HAVE_CURL_OLD_OPENSSL], [1], [Have cURL with old OpenSSL])
PKG_CHECK_MODULES([OPENSSL], [openssl], [
PHP_EVAL_LIBLINE($OPENSSL_LIBS, CURL_SHARED_LIBADD)
PHP_EVAL_INCLINE($OPENSSL_CFLAGS)
#endif
/* {{{ cruft for thread safe SSL crypto locks */
-#if defined(ZTS) && defined(HAVE_CURL_OPENSSL)
+#if defined(ZTS) && defined(HAVE_CURL_OLD_OPENSSL)
# if defined(HAVE_OPENSSL_CRYPTO_H)
# define PHP_CURL_NEED_OPENSSL_TSL
# include <openssl/crypto.h>
"openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
"cause random crashes on SSL requests"
# endif
-#endif /* ZTS && HAVE_CURL_OPENSSL */
+#endif /* ZTS && HAVE_CURL_OLD_OPENSSL */
/* }}} */
#define SMART_STR_PREALLOC 4096