|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20313 fsockopen fails with ssl://
Submitted: 2002-11-08 10:49 UTC Modified: 2002-11-08 12:02 UTC
From: chris dot baxter at ic24 dot net Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.2.3 OS: Linux Redhat 2.4.2-2
Private report: No CVE-ID: None
 [2002-11-08 10:49 UTC] chris dot baxter at ic24 dot net
Apache 1.3.27, OpenSSL 0.9.6b 

When adding ssl:// to my fsockopen routine it fails to open a connection but gives no reason for failure. If I remove ssl:// from the command it work fine and the server disconnects for failing to establish an ssl connection as I would expect.

// This opens a standard socket connection
//$fp = fsockopen("", 4437, $errno, $errstr);

// This doesn't open a socket or give a reason for failure
$fp = fsockopen("ssl://", 4437, $errno, $errstr);
if (!$fp) {
    echo "ERROR: $errno - $errstr<br>\n";
} else {
	echo "OK<br>\n";
    fwrite($fp,"my data is here\n");
    echo fread($fp, 26);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-08 10:58 UTC]
Please try using this CVS snapshot:
For Windows:
 [2002-11-08 12:02 UTC]
The support for SSL in fsockopen() is only available in 4.3.0-dev at the moment..4.2.3 does not have it.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri May 20 11:05:45 2022 UTC