php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19121 fsockopen("tls:// .... fails without reason.
Submitted: 2002-08-27 09:24 UTC Modified: 2002-08-27 18:38 UTC
From: mbabcock-php at fibrespeed dot net Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.2.2 OS: Linux 2.2.14
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mbabcock-php at fibrespeed dot net
New email:
PHP Version: OS:

 

 [2002-08-27 09:24 UTC] mbabcock-php at fibrespeed dot net
I'm doing the following:

$fp = fsockopen("tls://hostname.domain.com", 2080, $errno, $errstr, 30);
if (!$fp) die ("Unable to connect: $errstr ($errno)");

... its giving me "Unable to connect:  (0)" every time (hostname.domain.com is a valid Internet host I administer).  I'm running a "tcpdump -n port 2080" on the web server and there are no packets showing up at all.  There are no messages in /var/log/(messages|daemon|kern) or in the Apache error_log.    Any ideas?

Feel free to connect to https://www.fibrespeed.net/phpinfo.php  for information on my configuration.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-27 09:30 UTC] derick@php.net
Where did you read PHP supports tls:// ?

Derick
 [2002-08-27 09:32 UTC] derick@php.net
Never mind that, just lose the tls:// and you can connect fine, but of course you need to send encrypted packets yourself.
fsockopen opens a _socket_, not an URL.

User error -> bogus
 [2002-08-27 09:40 UTC] wez@php.net
The docs for fsockopen state:

As of PHP 4.3.0, if you have compiled in OpenSSL support, you may prefix the hostname with either 'ssl://' or 'tls://' to use an SSL or TLS client connection over TCP/IP to connect to the remote host.

Your version of PHP is not PHP 4.3, so this won't work.
 [2002-08-27 18:21 UTC] mbabcock-php at fibrespeed dot net
Thanks for the version check comment; for some reason I assumed that since I'd updated to the latest publically available version of php the day before starting this test that the feature was available.  Obviously, that is not true.  

It would be nice if someone encouraged derick@php.net to read the fine manuals himself instead of immediately pulling a 'user error -> bogus'.
 [2002-08-27 18:38 UTC] rasmus@php.net
4.2.2 was a security-fix release.  No new features.  The tls:// stuff is a new feature in 4.3 as documented.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 20:01:24 2020 UTC