#22061 [NEW]: file() fails to open a https URL when the site uses a self signed certificate

From: Date: Tue, 04 Feb 2003 23:51:56 +0000
Subject: #22061 [NEW]: file() fails to open a https URL when the site uses a self signed certificate
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32149@lists.php.net to get a copy of this message
From: amith@xalan.com Operating system: Linux Redhat 7.3 - 2.4.18 PHP version: 4.3.0 PHP Bug Type: URL related Bug description: file() fails to open a https URL when the site uses a self signed certificate The function file() fails when I try to open a https URL where the site uses a self-signed certificate. Example: <?php $var=file('https://mail.xalan.com'); var_dump($var); ?> This script fails. All that gets printed out is bool(false) In the apache error logs I get the following message: [Tue Feb 4 18:10:28 2003] [error] PHP Warning: file() [<a href='http://www.php.net/function.file'>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(https://mail.xalan.com) [<a href='http://www.php.net/function.file'>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: <?php $var=file('https://www.wachovia.com'); var_dump($var); ?> './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. -- Edit bug report at http://bugs.php.net/?id=22061&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=22061&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=22061&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=22061&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=22061&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=22061&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=22061&r=support Expected behavior: http://bugs.php.net/fix.php?id=22061&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=22061&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=22061&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=22061&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22061&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=22061&r=dst IIS Stability: http://bugs.php.net/fix.php?id=22061&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=22061&r=gnused

« previous php.bugs (#32149) next »