Re: fsockopen and https
| From: | Brad Hubbard | Date: | Fri, 26 Oct 2001 09:54:45 +0000 |
| Subject: | Re: fsockopen and https | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72426@lists.php.net to get a copy of this message | ||
On Fri, 26 Oct 2001 17:18, John wrote:
> Hello All,
>
> I am new to this list and am sure most of you are tired of this subject
> appearing. Please forgive me as I am becoming tired of searching archives
> and the internet and I am hoping someone here can help me.
>
> I am using fsockopen to post data to a dll on a SSL server. I setup the
> socket data and successfully posted the data to port 80 but as soon as I
> switch to port 443 I received no errors or text.
Does this help? I use this on web servers to test whether a transaction
server is available or not. Only works on *nix of course (sorry Bill :-)
<?php
$ph = popen( "/usr/bin/openssl s_client -connect secure.geicp.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://a.secure.server.com" );
exit;
}
?>
Cheers,
BAD