Jump to content

socket_connect to an ssl server


daffy duck

Recommended Posts

Hi I can do this easily with fsockopen ie

 

$fp = @fsockopen('ssl://epp.server.com', 700, $errno, $errstr, 100);

 

But I need to bind an IP address ie something like..

 

$bindip = 'xx.xx.xx.xx';

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

socket_bind($sock, $bindip);

socket_connect($sock, 'ssl://epp.server.com', 80);

 

This wont work of course as it does not know what ssl:// means.

 

Also

 

socket_connect($socket_handle, gethostbyname('epp.server.com'), 700)

 

Does not work as without the ssl its refusing to comunicate

 

 

What could I do to make this work. Can I combine fsockopen with socket_bind.

 

 

Link to comment
https://forums.phpfreaks.com/topic/101774-socket_connect-to-an-ssl-server/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.