Req #70939 [NEW]: socket_import_stream does not indicate missing support for SSL

From: Date: Wed, 18 Nov 2015 20:33:11 +0000
Subject: Req #70939 [NEW]: socket_import_stream does not indicate missing support for SSL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-197324@lists.php.net to get a copy of this message
From:             lcharron at meditech dot com
Operating system: Any
PHP version:      5.5.30
Package:          Sockets related
Bug Type:         Feature/Change Request
Bug description:socket_import_stream does not indicate missing support for SSL

Description:
------------
You should be able to obtain the socket from a socket-based SSL stream
so that socket options (ex. SO_KEEPALIVE) can be set.
The documentation makes no mention that this is not possible.

Test script:
---------------
$host = "host";
$port = "443";
$stream = stream_socket_client("ssl://{$host}:{$port}");
$socket = socket_import_stream($stream);
if ($socket) {

    socket_set_option($socket, SOL_SOCKET, SO_KEEPALIVE, 1);
}

Expected result:
----------------
socket_import_stream should return the underlying socket so options can
be set.

Actual result:
--------------
socket_import_stream returns null and the following warning is emitted:
Warning: socket_import_stream(): cannot represent a stream of type
tcp_socket/ssl as a Socket Descriptor in ...


-- 
Edit bug report at https://bugs.php.net/bug.php?id=70939&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70939&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70939&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70939&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70939&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70939&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70939&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70939&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70939&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70939&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70939&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70939&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70939&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70939&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70939&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70939&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70939&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70939&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70939&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70939&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70939&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#197324) next »