Bug #19351 [Fbk]: stream_socket_client
| From: | till@php.net | Date: | Mon, 26 Mar 2012 17:59:58 +0000 |
| Subject: | Bug #19351 [Fbk]: stream_socket_client | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8451@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19351&edit=1
ID: 19351
Updated by: till@php.net
Reported By: till at php dot net
Summary: stream_socket_client
Status: Feedback
Type: Bug
Package: HTTP_Request2
Package Version: 2.0.0
PHP Version: 5.3.8
Roadmap Versions:
New Comment:
I'll check out trunk in the meantime.
Previous Comments:
------------------------------------------------------------------------
[2012-03-26 18:59:19] till
I think my previous comment made no sense since the wrapper is 'ssl://'
not
'https://', my mistake, but I'm still debugging the
issue:
My remote is: https://metrics-api.librato.com/
In HTTP_Request2, this is turned into this:
'ssl://metrics-api.librato.com:443'. I came
up with this test script:
<?php
$ctx = stream_context_create(array(
'http' => array(
'ignore_errors' => true,
),
'ssl' => array(
'CN_match' => "metrics-api.librato.com",
'verify_peer' => true,
),
));
$remote = 'ssl://metrics-api.librato.com:443';
ini_set('track_errors', 1);
$socket = stream_socket_client($remote, $errno, $errstr, 2);
var_dump($socket);
var_dump($errno, $errstr);
if (isset($php_errormsg)) {
var_dump($php_errormsg);
}
This seems to set the same SSL-options HTTP_Request2 sets, but with
HTTP_Request2 I get an "unknown error" which I cannot reproduce with
this script.
Do you have any idea how I could debug this further?
------------------------------------------------------------------------
[2012-03-26 18:47:49] avb
-Status: Open
+Status: Feedback
Can you please test with current SVN version?
Fix for bug #19337 should have addressed this, exception message should
now contain all warnings produced by stream_socket_client() (there may
be several).
------------------------------------------------------------------------
[2012-03-26 18:45:02] till
Description:
------------
Hi,
I ran into another issue â basically, I'm connecting with
HTTP_Request2 to a remote ssl-server.
The exception contains "unknown error" (Line 324, in the socket
adapeter).
When I execute the code in a test-script, I get the following
error instead:
int(-1138572888)
string(98) "Unable to find the socket transport "https" - did you
forget to enable it when you configured PHP?"
($errno and $errstr from stream_socket_client, dumped).
So the error is a configuration issue, but what I mean is: Could
the correct error message be exposed with HTTP_Request2?
Would save some time debugging.
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19351&edit=1