Skip to content

Commit bc8fece

Browse files
committed
Don't warn if libcurl SSL library not detected
libcurl may link against 7 different ssl libraries, all of which are thread-safe -- apart from openssl, of course. We check for openssl and register locking callbacks in that case, but we should not warn if any other library is used.
1 parent e1f65e2 commit bc8fece

File tree

2 files changed

+10
-47
lines changed

2 files changed

+10
-47
lines changed

ext/curl/config.m4

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,8 @@ int main(int argc, char *argv[])
5050
}
5151
]])],[
5252
AC_MSG_RESULT([yes])
53-
AC_CHECK_HEADERS([openssl/crypto.h], [
54-
AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
55-
])
56-
], [
57-
AC_MSG_RESULT([no])
58-
], [
59-
AC_MSG_RESULT([no])
60-
])
61-
62-
AC_MSG_CHECKING([for gnutls support in libcurl])
63-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
64-
#include <strings.h>
65-
#include <curl/curl.h>
66-
67-
int main(int argc, char *argv[])
68-
{
69-
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
70-
71-
if (data && data->ssl_version && *data->ssl_version) {
72-
const char *ptr = data->ssl_version;
73-
74-
while(*ptr == ' ') ++ptr;
75-
return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1);
76-
}
77-
return 1;
78-
}
79-
]])], [
80-
AC_MSG_RESULT([yes])
81-
AC_DEFINE([HAVE_CURL_GNUTLS], [1], [Have cURL with GnuTLS support])
53+
AC_DEFINE([HAVE_CURL_OPENSSL], [1], [Have cURL with OpenSSL support])
54+
AC_CHECK_HEADERS([openssl/crypto.h])
8255
], [
8356
AC_MSG_RESULT([no])
8457
], [

ext/curl/interface.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,17 @@
4747
# ifdef PHP_WIN32
4848
# define PHP_CURL_NEED_OPENSSL_TSL
4949
# include <openssl/crypto.h>
50-
# else /* !PHP_WIN32 */
51-
# if defined(HAVE_CURL_OPENSSL)
52-
# if defined(HAVE_OPENSSL_CRYPTO_H)
53-
# define PHP_CURL_NEED_OPENSSL_TSL
54-
# include <openssl/crypto.h>
55-
# else
56-
# warning \
57-
"libcurl was compiled with OpenSSL support, but configure could not find " \
58-
"openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
59-
"cause random crashes on SSL requests"
60-
# endif
61-
# elif defined(HAVE_CURL_GNUTLS)
62-
/* Modern versions of GnuTLS use the nette backend rather than gcrypt, so there
63-
* is nothing to do here anymore. */
50+
# elif defined(HAVE_CURL_OPENSSL)
51+
# if defined(HAVE_OPENSSL_CRYPTO_H)
52+
# define PHP_CURL_NEED_OPENSSL_TSL
53+
# include <openssl/crypto.h>
6454
# else
6555
# warning \
66-
"libcurl was compiled with SSL support, but configure could not determine which" \
67-
"library was used; thus no SSL crypto locking callbacks will be set, which may " \
56+
"libcurl was compiled with OpenSSL support, but configure could not find " \
57+
"openssl/crypto.h; thus no SSL crypto locking callbacks will be set, which may " \
6858
"cause random crashes on SSL requests"
69-
# endif /* HAVE_CURL_OPENSSL || HAVE_CURL_GNUTLS */
70-
# endif /* PHP_WIN32 */
59+
# endif
60+
# endif /* HAVE_CURL_OPENSSL */
7161
#endif /* ZTS && HAVE_CURL_SSL */
7262
/* }}} */
7363

0 commit comments

Comments
 (0)