array('local_cert'=> $cert)) ); if ($socket = stream_socket_client( 'ssl://'.$host.':'.$port, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context) ) { fwrite($socket, "\n"); echo fread($socket,8192); fclose($socket); } else { echo "ERROR: $errno - $errstr\n"; }