add CURLOPT_PINNEDPUBLICKEY
authorMichael Wallner <mike@php.net>
Wed, 4 Feb 2015 14:10:53 +0000 (15:10 +0100)
committerMichael Wallner <mike@php.net>
Wed, 4 Feb 2015 14:10:53 +0000 (15:10 +0100)
package.xml
php_http_client_curl.c

index 830a546c87bde110bd61a8f51b61add9a2522fdd..77cd1a06b63a7bd4da8f2d651789ce521ddcdc2a 100644 (file)
@@ -50,6 +50,7 @@ v2: http://dev.iworks.at/ext-http/lcov/ext/http/
  <notes><![CDATA[
 + Added support for HTTP2 if libcurl was built with nghttp2 support.
 + Added http\Client\Curl\HTTP_VERSION_2_0 constant (libcurl >= 7.33.0)
++ Added pinned_publickey SSL request option (libcurl >= 7.39.0)
 ]]></notes>
  <contents>
   <dir name="/">
index 566e523b9154b67803abb8a11d67d58818820d91..01b0a0fee5174bd47c88fcf75153d2354228a2f0 100644 (file)
@@ -1400,6 +1400,12 @@ static void php_http_curle_options_init(php_http_options_t *registry TSRMLS_DC)
                if ((opt = php_http_option_register(registry, ZEND_STRL("enable_alpn"), CURLOPT_SSL_ENABLE_ALPN, IS_BOOL))) {
                        ZVAL_BOOL(&opt->defval, 1);
                }
+#endif
+#if PHP_HTTP_CURL_VERSION(7,39,0)
+               if ((opt = php_http_option_register(registry, ZEND_STRL("pinned_publickey"), CURLOPT_PINNEDPUBLICKEY, IS_STRING))) {
+                       opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_STRLEN;
+                       opt->flags |= PHP_HTTP_CURLE_OPTION_CHECK_BASEDIR;
+               }
 #endif
        }
 }