php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14023 curl does not initialize HTTPS correctly - hence does not work.
Submitted: 2001-11-12 00:26 UTC Modified: 2001-12-03 04:31 UTC
From: alan_k at hklc dot com Assigned:
Status: Closed Package: cURL related
PHP Version: 4.0CVS-2001-11-12 OS: linux debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alan_k at hklc dot com
New email:
PHP Version: OS:

 

 [2001-11-12 00:26 UTC] alan_k at hklc dot com
the curl.c file initializes curl with nothing, the curl init library will then skip the init for ssl, and hence all https connections will fail.
also CURLOPT_SSL_VERIFYHOST is not defined..
patch below..

regards
alan

--- curl.c      18 Oct 2001 19:24:51 -0000      1.94
+++ curl.c      12 Nov 2001 05:25:05 -0000
@@ -142,6 +142,7 @@
        REGISTER_CURL_CONSTANT(CURLOPT_SSLCERT);
        REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTPASSWD);
        REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER);
+       REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYHOST);
        REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE);
        REGISTER_CURL_CONSTANT(CURLOPT_SSLVERSION);
        REGISTER_CURL_CONSTANT(CURLOPT_TIMECONDITION);
@@ -253,7 +254,7 @@
        REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
        REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
        
-       if (curl_global_init(CURL_GLOBAL_NOTHING) != CURLE_OK) {
+       if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) {
                return FAILURE;
        }
 
@@ -658,6 +659,7 @@
        case CURLOPT_FRESH_CONNECT:
        case CURLOPT_FORBID_REUSE:
        case CURLOPT_CONNECTTIMEOUT:
+       case CURLOPT_SSL_VERIFYHOST:
        case CURLOPT_SSL_VERIFYPEER:
                convert_to_long_ex(zvalue);
                error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-12 04:17 UTC] alan_k at hklc dot com
also probably a good idea to add WIN32 inititialization as well eg. 
curl_global_init(CURL_GLOBAL_SSL && CURL_GLOBAL_WIN32)


 [2001-11-12 05:44 UTC] alan_k at hklc dot com
filed under correct type (oops)
 [2001-11-12 20:01 UTC] zeev@php.net
Patched in CVS (untested)
 [2001-11-16 01:23 UTC] alan_k at hklc dot com
better re-open this, the fixes below and the ones in CVS do not currently deal with conflicts between openssl and curl modules - (althought they will fix most common scenarios)

if curl.so and openssl.so are loaded -using dl() they will both attempt to initialize openssl. 

- It is probably not a common occurance - and as long as there is a bug report then somebody finding this happening has a chance of knowing what to do.

- workaround - either dont use openssl as a dl module (compile it into php) or dont user openssl and curl together as modules..
 [2001-12-03 04:31 UTC] sterling@php.net
Its not going to be handled either....
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 06:01:35 2024 UTC