#define PHP_HTTP_CURLE_OPTION_CHECK_STRLEN 0x0001
#define PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR 0x0002
#define PHP_HTTP_CURLE_OPTION_TRANSFORM_MS 0x0004
+#define PHP_HTTP_CURLE_OPTION_IGNORE_RC 0x0008
static ZEND_RESULT_CODE php_http_curle_option_set_ssl_verifyhost(php_http_option_t *opt, zval *val, void *userdata)
{
}
#endif
#if PHP_HTTP_CURL_VERSION(7,42,0) && (PHP_HTTP_HAVE_LIBCURL_NSS || PHP_HTTP_HAVE_LIBCURL_SECURETRANSPORT)
- php_http_option_register(ssl_registry, ZEND_STRL("falsestart"), CURLOPT_SSL_FALSESTART, _IS_BOOL);
+ if ((opt = php_http_option_register(ssl_registry, ZEND_STRL("falsestart"), CURLOPT_SSL_FALSESTART, _IS_BOOL))) {
+ opt->flags |= PHP_HTTP_CURLE_OPTION_IGNORE_RC;
+ }
#endif
#if PHP_HTTP_CURL_VERSION(7,61,0)
if ((opt = php_http_option_register(ssl_registry, ZEND_STRL("tls13_ciphers"), CURLOPT_TLS13_CIPHERS, IS_STRING))) {
}
#if PHP_HTTP_CURL_VERSION(7,64,1)
+# if !PHP_HTTP_HAVE_LIBCURL_ALT_SVC
+ if (PHP_HTTP_CURL_FEATURE(CURL_VERSION_ALTSVC)) {
+# endif
if ((opt = php_http_option_register(registry, ZEND_STRL("altsvc_ctrl"), CURLOPT_ALTSVC_CTRL, IS_LONG))) {
opt->setter = php_http_curle_option_set_altsvc_ctrl;
}
if ((opt = php_http_option_register(registry, ZEND_STRL("altsvc"), CURLOPT_ALTSVC, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR;
}
+# if !PHP_HTTP_HAVE_LIBCURL_ALT_SVC
+ }
+# endif
#endif
#if PHP_HTTP_CURL_VERSION(7,74,0)
+# if !PHP_HTTP_HAVE_LIBCURL_HSTS
+ if (PHP_HTTP_CURL_FEATURE(CURL_VERSION_HSTS)) {
+# endif
php_http_option_register(registry, ZEND_STRL("hsts_ctrl"), CURLOPT_HSTS_CTRL, IS_LONG);
if ((opt = php_http_option_register(registry, ZEND_STRL("hsts"), CURLOPT_HSTS, IS_STRING))) {
opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR;
}
+# if !PHP_HTTP_HAVE_LIBCURL_HSTS
+ }
+# endif
#endif
}
break;
}
if (rv != SUCCESS) {
- php_error_docref(NULL, E_NOTICE, "Could not set option %s (%s)", opt->name->val, curl_easy_strerror(rc));
+ if (opt->flags & PHP_HTTP_CURLE_OPTION_IGNORE_RC) {
+ rv = SUCCESS;
+ } else {
+ php_error_docref(NULL, E_NOTICE, "Could not set option %s (%s)", opt->name->val, curl_easy_strerror(rc));
+ }
}
return rv;
}