AC_MSG_RESULT([found: $CURL_CONFIG])
fi
+ CURL_SSL=`$CURL_CONFIG --features | $EGREP SSL`
+ if test CURL_SSL == "SSL"; then
+ AC_DEFINE([HTTP_HAVE_SSL], [1], [ ])
+ fi
+ AC_CHECK_HEADERS([openssl/crypto.h])
+
CURL_LIBS=`$CURL_CONFIG --libs`
PHP_ADD_INCLUDE($CURL_DIR/include)
CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
+ AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL");
AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "")
} else {
#include "phpstr/phpstr.h"
#ifdef HTTP_HAVE_CURL
+# if defined(ZTS) && defined(HTTP_HAVE_SSL)
+# if !defined(HAVE_OPENSSL_CRYPTO_H)
+# error "libcurl was compiled with OpenSSL support, but we have no crypto.h"
+# else
+# define HTTP_NEED_SSL
+# include <openssl/crypto.h>
+# endif
+# endif
# ifdef PHP_WIN32
# include <winsock2.h>
# endif
/* }}} */
/* {{{ SSL */
-#if defined(ZTS) && defined(HTTP_HAVE_CURL) && defined(HAVE_OPENSSL_CRYPTO_H)
-
-#include <openssl/crypto.h>
+#ifdef HTTP_NEED_SSL
static MUTEX_T *http_ssl_mutex = NULL;
#ifdef HTTP_HAVE_CURL
if (CURLE_OK == curl_global_init(CURL_GLOBAL_ALL)) {
-# if defined(ZTS) && defined(HAVE_OPENSSL_CRYPTO_H)
+# ifdef HTTP_NEED_SSL
curl_version_info_data *cvid = curl_version_info(CURLVERSION_NOW);
if (cvid && (cvid->features & CURL_VERSION_SSL)) {
http_ssl_init();
UNREGISTER_INI_ENTRIES();
#ifdef HTTP_HAVE_CURL
curl_global_cleanup();
-# if defined(ZTS) && defined(HAVE_OPENSSL_CRYPTO_H)
+# ifdef HTTP_NEED_SSL
if (http_ssl_mutex) {
http_ssl_cleanup();
}