Bug #69495 [NEW]: stream_socket_client with tls failing since 5.6.7
| From: | scott dot nebor at eigendev dot com | Date: | Tue, 21 Apr 2015 11:26:45 +0000 |
| Subject: | Bug #69495 [NEW]: stream_socket_client with tls failing since 5.6.7 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-192258@lists.php.net to get a copy of this message | ||
From: scott dot nebor at eigendev dot com
Operating system: Ubuntu 12.04
PHP version: 5.6.8
Package: Streams related
Bug Type: Bug
Bug description:stream_socket_client with tls failing since 5.6.7
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 bug report at https://bugs.php.net/bug.php?id=69495&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69495&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69495&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69495&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69495&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69495&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69495&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69495&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69495&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69495&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69495&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69495&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69495&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69495&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69495&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69495&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69495&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69495&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69495&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69495&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69495&r=mysqlcfg