Re: Openning a remote file, https problems
| From: | Brad Hubbard | Date: | Mon, 15 Oct 2001 01:32:43 +0000 |
| Subject: | Re: Openning a remote file, https problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71048@lists.php.net to get a copy of this message | ||
On Sun, 14 Oct 2001 03:08, user@domain.invalid wrote:
> My site opens a remote file for image manipulation. If I go to my site
> using http, then all works well and everyone is happy. However, if I
> visit my site using https, then I get an error that it is unable to open
> the remote file.
>
> I searched throughout the PHP site for awhile and was unable to find any
> documentation on this matter. What could be the possible problem?
Nice email address.
Is this what you're looking for? (assumes Linux/unix);
<?php
$ph = popen( "/usr/bin/openssl s_client -connect your.site.com:443
-quiet
2>/dev/null <<EOM\nGET / HTTP/1.0\n\nEOM\n", "r" );
$response = fgets( $ph, 1024 );
if( stristr( $response, "200 OK" ) )
{
header( "Location: https://your.site.com" );
exit;
}
?>
NOTE: The popen command is on one line.
Cheers,
Brad
--
Brad Hubbard
Congo Systems
12 Northgate Drive,
Thomastown, Victoria, Australia 3074
Email: brad@congosystems.com
Ph: +61-3-94645981
Fax: +61-3-94645982
Mob: +61-419107559