SSL Tunneling with PHP?

Hi !

I have a requirement where I need a connection to a secure host over port no. 8443.

They only allow connection through Secure Socket Tunnel.

I wrote a script and use below code:

$fp = fsockopen("ssl://","8443",$errno, $errstr);
if (!$fp)
	echo "$errstr ($errno)<br />\
        echo "Connected...";

Now the thing is that, every time I run this script, it earlier shown me “Connection Timeout (110)” and later it has been showing “Connected…”. But I do not think it is really connected. I think this Secure Socket Tunnel needs something else too.

Can you please help ?