Commit:    af10e698a24e0e624920ea4c4b72a2bc3c647cef
Author:    Pierrick Charron <pierr...@php.net>         Fri, 21 Dec 2012 
19:12:43 -0500
Parents:   517f800277a11d6ce05b0e1afcd0e76dc544d452
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=af10e698a24e0e624920ea4c4b72a2bc3c647cef

Log:
Fixed bug #63352 (Can't enable hostname validation when using curl stream 
wrappers)

Bugs:
https://bugs.php.net/63352

Changed paths:
  M  ext/curl/streams.c


Diff:
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 75a2bd0..0532b87 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -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);
                }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to