fi
])
+ dnl
+ dnl HTTP_CURL_SSL_LIB_CHECK(ssllib[, code-if-yes[, code-if-not])
+ dnl
+ AC_DEFUN([HTTP_CURL_SSL_LIB_CHECK], [
+ AC_MSG_CHECKING([for $1 support in libcurl])
+ AC_TRY_RUN([
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+ if (data && data->ssl_version && *data->ssl_version) {
+ const char *ptr = data->ssl_version;
+ while(*ptr == ' ') ++ptr;
+ return strncasecmp(ptr, "$1", sizeof("$1")-1);
+ }
+ return 1;
+ }
+ ], [
+ AC_MSG_RESULT([yes])
+ $2
+ ], [
+ AC_MSG_RESULT([no])
+ $3
+ ], [
+ AC_MSG_RESULT([no])
+ $3
+ ])
+ ])
+
dnl ----
dnl STDC
AC_MSG_RESULT([yes])
AC_DEFINE([PHP_HTTP_HAVE_SSL], [1], [ ])
- AC_MSG_CHECKING([for openssl support in libcurl])
- AC_TRY_RUN([
- #include <curl/curl.h>
- int main(int argc, char *argv[]) {
- curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
- if (data && data->ssl_version && *data->ssl_version) {
- const char *ptr = data->ssl_version;
- while(*ptr == ' ') ++ptr;
- return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1);
- }
- return 1;
- }
- ], [
- AC_MSG_RESULT([yes])
+ HTTP_CURL_SSL_LIB_CHECK(OpenSSL, [
AC_CHECK_HEADER([openssl/ssl.h], [
AC_CHECK_HEADER([openssl/crypto.h], [
AC_DEFINE([PHP_HTTP_HAVE_OPENSSL], [1], [ ])
CURL_SSL_LIBS="ssl crypto"
])
])
- ], [
- AC_MSG_RESULT([no])
- ], [
- AC_MSG_RESULT([no])
])
-
- AC_MSG_CHECKING([for gnutls support in libcurl])
- AC_TRY_RUN([
- #include <curl/curl.h>
- int main(int argc, char *argv[]) {
- curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
- if (data && data->ssl_version && *data->ssl_version) {
- const char *ptr = data->ssl_version;
- while(*ptr == ' ') ++ptr;
- return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1);
- }
- return 1;
- }
- ], [
- AC_MSG_RESULT([yes])
+ HTTP_CURL_SSL_LIB_CHECK(GnuTLS, [
AC_CHECK_HEADER([gnutls.h], [
AC_CHECK_HEADER([gcrypt.h], [
AC_DEFINE([PHP_HTTP_HAVE_GNUTLS], [1], [ ])
CURL_SSL_LIBS="gnutls gcrypt"
])
])
- ], [
- AC_MSG_RESULT([no])
- ], [
- AC_MSG_RESULT([no])
+ ])
+ HTTP_CURL_SSL_LIB_CHECK(NSS, [
+ AC_DEFINE([PHP_HTTP_HAVE_NSS], [1], [ ])
+ ])
+ HTTP_CURL_SSL_LIB_CHECK(SecureTransport, [
+ AC_DEFINE([PHP_HTTP_HAVE_DARWINSSL], [1], [ ])
])
else
+ dnl no CURL_SSL
AC_MSG_RESULT([no])
fi
}
#endif
-#if PHP_HTTP_CURL_VERSION(7,19,1) && defined(PHP_HTTP_HAVE_OPENSSL)
+#if (PHP_HTTP_CURL_VERSION(7,19,1) && defined(PHP_HTTP_HAVE_OPENSSL)) || (PHP_HTTP_CURL_VERSION(7,42,0) && defined(PHP_HTTP_HAVE_GNUTLS))
{
int i;
zval *ci_array;
opt->setter = php_http_curle_option_set_proxyheader;
}
#endif
+#if PHP_HTTP_CURL_VERSION(7,43,0)
+ if ((opt = php_http_option_register(registry, ZEND_STRL("proxy_service_name"), CURLOPT_PROXY_SERVICE_NAME, IS_STRING))) {
+ opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
+ }
+#endif
#if PHP_HTTP_CURL_VERSION(7,40,0)
if ((opt = php_http_option_register(registry, ZEND_STRL("unix_socket_path"), CURLOPT_UNIX_SOCKET_PATH, IS_STRING))) {
if ((opt = php_http_option_register(registry, ZEND_STRL("httpauthtype"), CURLOPT_HTTPAUTH, IS_LONG))) {
Z_LVAL(opt->defval) = CURLAUTH_ANYSAFE;
}
+#if PHP_HTTP_CURL_VERSION(7,43,0)
+ if ((opt = php_http_option_register(registry, ZEND_STRL("service_name"), CURLOPT_SERVICE_NAME, IS_STRING))) {
+ opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
+ }
+#endif
/* redirects */
if ((opt = php_http_option_register(registry, ZEND_STRL("redirect"), CURLOPT_FOLLOWLOCATION, IS_LONG))) {
if ((opt = php_http_option_register(registry, ZEND_STRL("tlsauthpass"), CURLOPT_TLSAUTH_PASSWORD, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
}
+#endif
+#if PHP_HTTP_CURL_VERSION(7,42,0) && (defined(PHP_HTTP_HAVE_NSS) || defined(PHP_HTTP_HAVE_DARWINSSL))
+ php_http_option_register(registry, ZEND_STRL("falsestart"), CURLOPT_SSL_FALSESTART, IS_BOOL);
#endif
}
}