|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43796 stream_set_timeout() does not work with ssl
Submitted: 2008-01-09 10:52 UTC Modified: 2008-05-27 01:00 UTC
Avg. Score:4.8 ± 0.6
Reproduced:13 of 13 (100.0%)
Same Version:5 (38.5%)
Same OS:7 (53.8%)
From: kirsch at mediafinanz dot de Assigned:
Status: No Feedback Package: Streams related
PHP Version: 5.2.5 OS: Windows XP SP 2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: kirsch at mediafinanz dot de
New email:
PHP Version: OS:


 [2008-01-09 10:52 UTC] kirsch at mediafinanz dot de
The function stream_set_timeout seems not to work with ssl. The timeout is ignored and the script runs till the maximum execution timeout is reached. Problem occurred on my development PC (Windows XP SP 2, PHP 5.2.5, Apache 2.6) and also on our Test-System (SuSE Linux 10, PHP 5.2.1, Apache 2.4). stream_set_timeout works when not using ssl.

Reproduce code:
$fp = fsockopen("ssl://", 443);
//endlessloop.php is simply running an endless while loop without output
fwrite($fp, "GET /endlessloop.php HTTP/1.0\r\n\r\n");
$timeoutSet = stream_set_timeout($fp, 5);
if ($timeoutSet)
    $res = fread($fp, 2000);
    $info = stream_get_meta_data($fp);
    if ($info['timed_out'])
        echo 'Connection timed out!';flush();
       echo $res;

Expected result:
After 5 seconds of trying to read an result without success, the connection should time out and output "Connection timed out";

Actual result:
After 60 seconds of trying to read from the stream, the fatal error "maximum execution time exeeded" occurrs.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-27 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 May 23 23:01:32 2024 UTC