file() and https URLs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
akv6p
Forum Newbie
Posts: 2
Joined: Tue Feb 04, 2003 6:10 pm

file() and https URLs

Post 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
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post 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).
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

have you tried opening the file through the file system as apposed to a URL?
akv6p
Forum Newbie
Posts: 2
Joined: Tue Feb 04, 2003 6:10 pm

Post 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)
Post Reply