|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22061 file() fails to open a https URL when the site uses a self signed certificate
Submitted: 2003-02-04 17:51 UTC Modified: 2003-02-04 18:06 UTC
From: amith at xalan dot com Assigned:
Status: Not a bug Package: URL related
PHP Version: 4.3.0 OS: Linux Redhat 7.3 - 2.4.18
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.
Block user comment
Status: Assign to:
Bug Type:
From: amith at xalan dot com
New email:
PHP Version: OS:


 [2003-02-04 17:51 UTC] amith at xalan dot com
The function file() fails when I try to open a https URL where the site uses a self-signed certificate.





This script fails.  All that gets printed out is


In the apache error logs I get the following message:

[Tue Feb  4 18:10:28 2003] [error] PHP Warning:  file() [<a href=''>function.file</a>]: php_hostconnect: connect failed in /usr/local/apache/htdocs/test_ssl.php on line 3
[Tue Feb  4 18:10:28 2003] [error] PHP Warning:  file( [<a href=''>function.file</a>]: failed to create stream: Connection timed out in /usr/local/apache/htdocs/test_ssl.php on line 3

However, if I substitute the URL with a site that uses a trusted certificate it works fine:




 './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-openssl=/usr/local/ssl' '--with-bz2' '--with-pspell' '--with-db3=/usr/lib' '--enable-ftp' '--with-gd' '--with-imap=/usr/local/imap-2002b' '--with-imap-ssl=/usr/local/imap-2002b' '--with-ldap' '--with-jpeg-dir=/usr/lib' '--with-xpm-dir=/usr/lib' '--with-freetype-dir=/usr/lib' '--enable-sigchild' '--with-gettext' '--with-mcrypt' '--with-xml' '--with-mysql=/usr/local/mysql' '--with-mhash' '--with-zlib' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-png-dir=/usr/lib' '--enable-mime-magic'

Also my max_execution_time = 90000.  The URL loads in less than 2 seconds when I use my browser.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-04 18:01 UTC] amith at xalan dot com
actually the problem is not with self signed certificates, its when the name on the certificate doesn't match the URL used.  Since this is a security issue, I doubt it will be changed.  I will ask on the mailing list about what the right way to do this is.  This is not a bug
 [2003-02-04 18:06 UTC]
not bug -> bogus.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 21:01:28 2024 UTC