From b8b53217575c2e7b091588b97b95324d50b921ff Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 4 Feb 2015 15:10:53 +0100 Subject: [PATCH] add CURLOPT_PINNEDPUBLICKEY --- package.xml | 1 + php_http_client_curl.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/package.xml b/package.xml index 830a546..77cd1a0 100644 --- a/package.xml +++ b/package.xml @@ -50,6 +50,7 @@ v2: http://dev.iworks.at/ext-http/lcov/ext/http/ = 7.33.0) ++ Added pinned_publickey SSL request option (libcurl >= 7.39.0) ]]> diff --git a/php_http_client_curl.c b/php_http_client_curl.c index 566e523..01b0a0f 100644 --- a/php_http_client_curl.c +++ b/php_http_client_curl.c @@ -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 } } -- 2.30.2