Description
After Initiating a TCP-Server I wanted to enable TLS encryption with the following code:
$socket = stream_socket_server("tcp://0.0.0.0:8000", $errno, $errstr);
$options = [
'ssl' => [
'local_cert' => '/not/a/real/path/to/file.cert',
'local_pk' => '/not/a/real/path/to/file.key',
],
];
echo stream_context_set_options($socket, $options);
After execution stream_context_set_options return true, even if the files for encrypting connections is missing
PHP Version
PHP 8.4.21 (cli) (built: May 7 2026 18:46:27) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.21, Copyright (c) Zend Technologies
with Zend OPcache v8.4.21, Copyright (c), by Zend Technologies
Operating System
Debian 13 Trixie
Description
After Initiating a TCP-Server I wanted to enable TLS encryption with the following code:
After execution
stream_context_set_optionsreturn true, even if the files for encrypting connections is missingPHP Version
Operating System
Debian 13 Trixie