Bug #69495 [Opn]: stream_socket_client with tls failing since 5.6.7
| From: | mike@php.net | Date: | Thu, 16 Jul 2015 07:13:51 +0000 |
| Subject: | Bug #69495 [Opn]: stream_socket_client with tls failing since 5.6.7 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194481@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69495&edit=1
ID: 69495
Updated by: mike@php.net
Reported by: scott dot nebor at eigendev dot com
Summary: stream_socket_client with tls failing since 5.6.7
Status: Open
Type: Bug
Package: Streams related
Operating System: Ubuntu 12.04
PHP Version: 5.6.8
-Assigned To:
+Assigned To: rdlowrey
Block user comment: N
Private report: N
New Comment:
Daniel, haven't there been changes to how the proto:// part is interpreted?
Previous Comments:
------------------------------------------------------------------------
[2015-04-21 11:26:44] scott dot nebor at eigendev dot com
Description:
------------
tls connections using stream_socket_client appear to be failing since php 5.6.7 (it's happening
in both 5.6.7 and 5.6.8)
Connections are failing with the error message: "stream_socket_client(): Failed to enable
crypto"
The following snippet of code works in php 5.6.6 and lower, but fails in 5.6.7/5.6.8
$contextArray['ssl']['cafile'] ='/pathtomycafile.pem'
$contextArray['ssl']['local_cert'] ='/pathtomycertfile.pem'
$contextArray['ssl']['peer_name']= 'mypeername'
$context = stream_context_create($contextArray);
$myhost='myhost';
$myport='12345';
$sock = stream_socket_client('tls://$myhost:$myport, $errno, $errstr, 5, STREAM_CLIENT_CONNECT,
$context);
As a workaround, the stream_socket_client call can be changed to use ssl instead, which works in
5.6.6 and 5.6.7/5.6.8
$sock = stream_socket_client('ssl://$myhost:$myport, $errno, $errstr, 5, STREAM_CLIENT_CONNECT,
$context);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69495&edit=1