From: noah at rave dot ca Operating system: Windows Server 2003 PHP version: 5.2.7RC2 PHP Bug Type: URL related Bug description: Fsockopen Timeout Can't Be Under 1.0 With SSL
Description: ------------ When you use fsockopen and connect to SSL if the timeout is less then 1.0 it will cause an error... If it's 1.0 or over it will work as expected... Reproduce code: --------------- if ($fp = fsockopen('ssl://www.website.com', 443, $errno, $errstr, 0.1)) { $out = "GET /schedule/schedule_end/ HTTP/1.1\r\n"; $out .= "Host: www.website.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fputs($fp, $out); fclose($fp); } SHOWS ERROR: Warning: fsockopen() [function.fsockopen]: SSL: connection timeout in C:\Websites\website.com\website\include\show\admin\a.php on line 2 Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in C:\Websites\website.com\website\include\show\admin\a.php on line 2 Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.website.com:443 (Unknown error) in C:\Websites\website.com\website\include\show\admin\a.php on line 2 if ($fp = fsockopen('ssl://www.website.com', 443, $errno, $errstr, 1)) { $out = "GET /schedule/schedule_end/ HTTP/1.1\r\n"; $out .= "Host: www.website.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fputs($fp, $out); fclose($fp); } WORKS AS EXPECTED!!! Expected result: ---------------- It should run with a 0.05, 0.1 or 0.99 timeout as it did in previous versions... -- Edit bug report at http://bugs.php.net/?id=46512&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46512&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46512&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46512&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46512&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46512&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46512&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46512&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46512&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46512&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46512&r=support Expected behavior: http://bugs.php.net/fix.php?id=46512&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46512&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46512&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46512&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46512&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46512&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46512&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46512&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46512&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46512&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46512&r=mysqlcfg