@@ -26,7 +26,7 @@ if test "$PHP_CURL" != "no"; then
26
26
save_LDFLAGS="$LDFLAGS"
27
27
LDFLAGS="$LDFLAGS $CURL_LIBS"
28
28
29
- AC_MSG_CHECKING ( [ for openssl support in libcurl ] )
29
+ AC_MSG_CHECKING ( [ for libcurl linked against old openssl ] )
30
30
AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
31
31
#include <strings.h>
32
32
#include <curl/curl.h>
@@ -39,13 +39,23 @@ int main(int argc, char *argv[])
39
39
const char *ptr = data->ssl_version;
40
40
41
41
while(*ptr == ' ') ++ptr;
42
- return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1);
42
+ if (strncasecmp(ptr, "OpenSSL/1.1", sizeof("OpenSSL/1.1")-1) == 0) {
43
+ /* New OpenSSL version */
44
+ return 3;
45
+ }
46
+ if (strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1) == 0) {
47
+ /* Old OpenSSL version */
48
+ return 0;
49
+ }
50
+ /* Different SSL library */
51
+ return 2;
43
52
}
53
+ /* No SSL support */
44
54
return 1;
45
55
}
46
56
] ] ) ] ,[
47
57
AC_MSG_RESULT ( [ yes] )
48
- AC_DEFINE ( [ HAVE_CURL_OPENSSL ] , [ 1] , [ Have cURL with OpenSSL support ] )
58
+ AC_DEFINE ( [ HAVE_CURL_OLD_OPENSSL ] , [ 1] , [ Have cURL with old OpenSSL ] )
49
59
PKG_CHECK_MODULES([ OPENSSL] , [ openssl] , [
50
60
PHP_EVAL_LIBLINE($OPENSSL_LIBS, CURL_SHARED_LIBADD)
51
61
PHP_EVAL_INCLINE($OPENSSL_CFLAGS)
0 commit comments