Re: fsockopen and https
| From: | John | Date: | Sat, 27 Oct 2001 17:10:43 +0000 |
| Subject: | Re: fsockopen and https | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72571@lists.php.net to get a copy of this message | ||
From: "Brad Hubbard" <brad@congosystems.com>
> > 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;
> }
>
> ?>
Excellent! This is exactly what I needed. I now have a class interfacing
with my gateway and do not need cURL!
Thanks a bunch!
-John-