cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Can / how do to this with curl, bind IP connect to ssl server

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Sat, 19 Apr 2008 10:13:04 -0700

On Sat, Apr 19, 2008 at 04:25:34PM +0100, Alan Willsher wrote:
> Hi Im trying to find an alternative way to do this ...
>
> $bindip = 'xx.xx.xx.xx'; // IP to use
> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> socket_bind($sock, $bindip);
> socket_connect($sock, 'ssl://epp.server.com', 700); // connect to ssl server
> $response = socket_read($socket,2046,PHP_NORMAL_READ);
> echo $response;
>
> The above does not work as the socket function does not understand ssl:// in
> the destination address.
> Also if I try connect at the IP it fails as the destination rejects the
> connection without using the ssl://
>
> ie using..
>
> socket_connect($socket_handle, gethostbyname('epp.server.com'), 700)
>
> Is it possible to do the above through Curl. Bind an IP and then connect to
> ssl://epp.server.com 700 ?
>
> Fsockopen on its own does not allow me to bind an address.

This looks like a PHP question; this list isn't where the PHP people hang
out. curl is designed for file transfers, not raw socket operations; the
command-line tool and library don't let you do operations this close to
the metal.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-04-19