iliaa           Wed Aug 30 17:49:10 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/ext/curl   streams.c 
  Log:
  Fixed bug #33770 (https:// or ftps:// do not work when --with-curlwrappers
  is used and ssl certificate is not verifiable). 
  
    
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.226&r2=1.2027.2.547.2.227&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.226 php-src/NEWS:1.2027.2.547.2.227
--- php-src/NEWS:1.2027.2.547.2.226     Wed Aug 30 10:42:49 2006
+++ php-src/NEWS        Wed Aug 30 17:49:10 2006
@@ -30,6 +30,8 @@
 - Fixed bug #38265 (heap corruption). (Dmitry)
 - Fixed bug #38199 (fclose() unable to close STDOUT and STDERR). (Tony)
 - Fixed bug #33895 (Missing math constants). (Hannes)
+- Fixed bug #33770 (https:// or ftps:// do not work when --with-curlwrappers 
+  is used and ssl certificate is not verifiable). (Ilia)
 - Fixed PECL bug #8112 (OCI8 persistent connections misbehave when Apache 
   process times out). (Tony)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/curl/streams.c?r1=1.14.2.2.2.5&r2=1.14.2.2.2.6&diff_format=u
Index: php-src/ext/curl/streams.c
diff -u php-src/ext/curl/streams.c:1.14.2.2.2.5 
php-src/ext/curl/streams.c:1.14.2.2.2.6
--- php-src/ext/curl/streams.c:1.14.2.2.2.5     Thu Aug 10 15:02:41 2006
+++ php-src/ext/curl/streams.c  Wed Aug 30 17:49:10 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: streams.c,v 1.14.2.2.2.5 2006/08/10 15:02:41 iliaa Exp $ */
+/* $Id: streams.c,v 1.14.2.2.2.6 2006/08/30 17:49:10 iliaa Exp $ */
 
 /* This file implements cURL based wrappers.
  * NOTE: If you are implementing your own streams that are intended to
@@ -301,6 +301,17 @@
        
        /* TODO: read cookies and options from context */
        if (context && !strncasecmp(filename, "http", sizeof("http")-1)) {
+               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);
+               } else {
+                       curl_easy_setopt(curlstream->curl, 
CURLOPT_SSL_VERIFYHOST, 0);
+               }
+               if (SUCCESS == php_stream_context_get_option(context, "http", 
"curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && 
Z_LVAL_PP(ctx_opt) == 1) {
+                       curl_easy_setopt(curlstream->curl, 
CURLOPT_SSL_VERIFYPEER, 1);
+               } else {
+                       curl_easy_setopt(curlstream->curl, 
CURLOPT_SSL_VERIFYPEER, 0);
+               }
+
                /* HTTP(S) */
                if (SUCCESS == php_stream_context_get_option(context, "http", 
"user_agent", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_STRING) {
                        curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, 
Z_STRVAL_PP(ctx_opt));
@@ -364,6 +375,17 @@
                        }
                        curl_easy_setopt(curlstream->curl, CURLOPT_MAXREDIRS, 
20L);
                }
+       } 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);
+               } else {
+                       curl_easy_setopt(curlstream->curl, 
CURLOPT_SSL_VERIFYHOST, 0);
+               }
+               if (SUCCESS == php_stream_context_get_option(context, "ftp", 
"curl_verify_ssl_peer", &ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_BOOL && 
Z_LVAL_PP(ctx_opt) == 1) {
+                       curl_easy_setopt(curlstream->curl, 
CURLOPT_SSL_VERIFYPEER, 1);
+               } else {
+                       curl_easy_setopt(curlstream->curl, 
CURLOPT_SSL_VERIFYPEER, 0);
+               }
        }
 
        /* prepare for "pull" mode */

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

Reply via email to