Bug #69495 [Asn->Opn]: stream_socket_client with tls failing since 5.6.7
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 06:20:10 +0000 |
| Subject: | Bug #69495 [Asn->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-211997@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: kalle@php.net
Reported by: scott dot nebor at eigendev dot com
Summary: stream_socket_client with tls failing since 5.6.7
-Status: Assigned
+Status: Open
Type: Bug
Package: Streams related
Operating System: Ubuntu 12.04
PHP Version: 5.6.8
-Assigned To: rdlowrey
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-07-16 07:13:49] mike@php.net
Daniel, haven't there been changes to how the proto:// part is interpreted?
------------------------------------------------------------------------
[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