php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38180 curl_errno:35, Unknown SSL protocol
Submitted: 2006-07-21 18:15 UTC Modified: 2006-07-22 13:05 UTC
From: martin dot wirth dot job1 at miradigm dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.1.4 OS: 2.4.20-021stab028.17.777-enterpr
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: martin dot wirth dot job1 at miradigm dot com
New email:
PHP Version: OS:

 

 [2006-07-21 18:15 UTC] martin dot wirth dot job1 at miradigm dot com
Description:
------------
Upgrading from PHP 4.2 to PHP 5.1.4 broke the cURL connection.


Reproduce code:
---------------
The following code worked with PHP 4.2 but now produces no response:

$ch = curl_init($gateway);
curl_setopt($ch, CURLOPT_VERBOSE,TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
$res = curl_exec($ch);
curl_close ($ch);

After upgrading to PHP 5.1.4 only the command line works:

$res = exec("/usr/bin/curl -iL -d '$postdata' --url '$gateway'");

The gateway is a secure web site connected with my secure web site where both URLs begin with "https://".

Although my workaround solves the problem. There is now a bug between cURL and PHP5.


Expected result:
----------------
Top example returns nothing but should return a response into array $res.

Bottom example returns that same as prior to PHP5 upgrade. It is a patch that demonstrate that the cURL lib may be working correctly while the new version of PHP may have an interfacing issue with it.


Actual result:
--------------
curl_errno() returns error 35 "Unknown SSL protocol..." after curl_exec().

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-21 18:39 UTC] mike@php.net
Make sure the https server is really SSL enabled.
 [2006-07-22 13:05 UTC] martin dot wirth dot job1 at miradigm dot com
My web host recompiled Apache --with-openssl and curl_error($ch) still returns:

Unknown SSL protocol error in connection to [secure site]:443

The certs are OK. The secure domain presents correctly. So, Apache seems to know where the CA information is.

In case Apache was passing wrong information to PHP and cURL, I also tried setting CURLOPT_SSL_VERIFYPEER true and CURLOPT_CAPATH explicitly to the following:
[absolute path]/ssl 
[absolute path]/ssl/certs 
[absolute path]/ssl/CA 

These tests produced the same disappointing result.

The exec(...) workaround still succeeds.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC