|
Posted by joel.washburn on 11/23/05 18:51
I've found the answer!
$certFile = './yourcert.pem';
$passPhrase = 'yourpassphrase';
$context = stream_context_create();
$result = stream_context_set_option($context, 'ssl', 'local_cert',
$certFile);
if($passPhrase)
$result = stream_context_set_option($context, 'ssl', 'passphrase',
$passPhrase);
$result = stream_context_set_option($context, 'ssl', 'verify_peer',
false);
$result = stream_context_set_option($context, 'ssl', 'verify_host',
false);
$result = stream_context_set_option($context, 'ssl',
'allow_self_signed', true);
$sock = stream_socket_client('ssl://www.somewhere.com:443',
&$errno,&$errstr, 60, STREAM_CLIENT_CONNECT, $context);
Navigation:
[Reply to this message]
|