]> granicus.if.org Git - php/commitdiff
Fixed bug #63352 (Can't enable hostname validation when using curl stream wrappers)
authorPierrick Charron <pierrick@php.net>
Sat, 22 Dec 2012 00:12:43 +0000 (19:12 -0500)
committerPierrick Charron <pierrick@php.net>
Sat, 22 Dec 2012 00:12:43 +0000 (19:12 -0500)
ext/curl/streams.c

index 75a2bd08c1066f733be6d8c8f4924f164edeca65..0532b87993b40af1d7a24adce833b5fde3c22fce 100644 (file)
@@ -331,7 +331,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
                }
 
                if (SUCCESS == php_stream_context_get_option(context, "http", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
-                       curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1);
+                       curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 2);
                } else {
                        curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
                }
@@ -420,7 +420,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
                }
        } else if (context && !strncasecmp(filename, "ftps", sizeof("ftps")-1)) {
                if (SUCCESS == php_stream_context_get_option(context, "ftp", "curl_verify_ssl_host", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && Z_LVAL_PP(ctx_opt) == 1) {
-                       curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 1);
+                       curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 2);
                } else {
                        curl_easy_setopt(curlstream->curl, CURLOPT_SSL_VERIFYHOST, 0);
                }