|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-26 22:28 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ Creating a SSL connection using fsocket yields an error My operating system is Debian , and configure line is as follows : './configure' '--prefix=/usr/phpapache2' '--with-apxs2=/usr/local/apache2/bin/apxs' '--disable-cgi' '--disable-cli' '--with-config-file-path=/etc/php4/apache' '--enable-inline-optimization' '--disable-debug' '--disable-rpath' '--disable-static' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--with-bz2' '--disable-ctype' '--with-iconv' '--enable-exif' '--enable-ftp' '--with-gettext' '--disable-ipv6' '--disable-wddx' '--disable-posix' '--with-expat-dir=/usr' '--with-zlib' '--without-pgsql' '--enable-zip=/usr' '--with-exec-dir=/usr/lib/php4/libexec' '--without-sybase-ct' '--with-mysql=/usr' '--with-gd' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-ttf=shared,/usr' '--with-t1lib' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--with-sqlite' '--with-mysqli' '--with-xsl' '--enable-ctype' '--with-pdo-mysql' '--with-xmlrpc' '--without-pdo-sqlite' '--enable-mbstring' '--disable-inifile' '--disable-flatfile' '--with-openssl' '--enable-sockets' running php 5.2.9 Reproduce code: --------------- When trying the following code : <?php $fp = fsockopen("ssl://anysecuresite.net" , 443, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: anysecuresite.net\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); } ?> Expected result: ---------------- see the webpage collected Actual result: -------------- Warning: fsockopen() [function.fsockopen]: SSL: connection timeout in /path/to/file/p.php on line 2 Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /path/to/file/p.php on line 2