php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46512 fsockopen() timeout can't be below 1.0 with SSL
Submitted: 2008-11-06 20:35 UTC Modified: 2008-11-16 01:00 UTC
From: noah at rave dot ca Assigned: dsp (profile)
Status: No Feedback Package: OpenSSL related
PHP Version: 5.2.7RC2 OS: Windows Server 2003
Private report: No CVE-ID: None
 [2008-11-06 20:35 UTC] noah at rave dot ca
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...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-06 20:40 UTC] noah at rave dot ca
I'm actually using RC3, which is not in the list...
 [2008-11-08 23:38 UTC] dsp@php.net
In which version did it work for you. For me it seems to be the same behaviour as in PHP 5.2.6. I tested it on Linux.
 [2008-11-11 17:32 UTC] noah at rave dot ca
I'll do some tests tomorrow (Wednesday), I been out of town sorry. I'll let you know.
 [2008-11-16 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC