Page 1 of 1

file() and https URLs

Posted: Tue Feb 04, 2003 6:10 pm
by akv6p
I'm trying to use file() to open an https URL. However, PHP fails to open the URL because the URL I am trying to open doesn't match the domain on the certificate. This is because my ISP gives me only 1 IP address and I am using name-based virtual hosts in Apache. Is there any way to read this URL? I am aware of the security issues involved in this, but its not sensitive information. Any info would be great. BTW, I am using PHP 4.3.0

Thanks
Amith

Posted: Tue Feb 04, 2003 8:11 pm
by Stoker
According to http://www.php.net/manual/en/wrappers.php SSL support was added in 4.3 and uses openssl, perhaps there are some environment variables that can be set to make openssl skip host verification?

If you have curl on your system (and curl/ssl enabled in PHP) you can use the option CURLOPT_SSL_VERIFYHOST to disable it.. (or -k if using command line).

Posted: Wed Feb 05, 2003 6:36 am
by Wayne
have you tried opening the file through the file system as apposed to a URL?

Posted: Wed Feb 05, 2003 9:33 am
by akv6p
If i change the code to do that then it limiits the ability to read external sources (The file is a URL for a free/busy calendar)