From: Jacek at veo dot pl Operating system: SuSE Linux 9.1 PHP version: 5.1.2 PHP Bug Type: Sockets related Bug description: Cannot enable encryption for stream server
Description: ------------ I am creating a SMTP server based on PHP. I have a problem with TLS encryption. I tried to enable crypto after stream_socket_accept - it failed. ./configure --with-apxs2 --with-config-file-path --with-libxml-dir --with-zlib --with-zlib-dir --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-dba --with-inifile --with-flatfile --enable-dbase --enable-exif --enable-filepro --enable-ftp --with-openssl --with-openssl-dir --with-gd --with-jpeg-dir --with-png-dir --without-xpm-dir --with-freetype-dir --enable-gd-native-ttf --with-imap --with-imap-ssl --enable-mbstring --with-mysql --with-mysqli --with-pdo-mysql --enable-soap --enable-sockets --enable-sqlite-utf8 --with-xmlreader --enable-memory-limit --with-iconv --with-ncurses Reproduce code: --------------- <?php $context = stream_context_create(); stream_context_set_option($context, 'tls', 'local_cert', '/server.misc'); echo 1; $ssl = stream_socket_server('tls://0.0.0.0:4445', $errnum, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context); echo 2; stream_socket_enable_crypto($ssl, TRUE, STREAM_CRYPTO_METHOD_TLS_SERVER); echo 3; fclose($ssl); ?> Expected result: ---------------- 123 Actual result: -------------- 12 And script is running. When I try to connect - I can, but script don't "go ahead". -- Edit bug report at http://bugs.php.net/?id=36445&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36445&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36445&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36445&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36445&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36445&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36445&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36445&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36445&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36445&r=support Expected behavior: http://bugs.php.net/fix.php?id=36445&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36445&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36445&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36445&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36445&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36445&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36445&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36445&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36445&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36445&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36445&r=mysqlcfg