autoswitch between http and ssl, how?

B3rt

Verified User
Joined
Oct 12, 2007
Messages
81
Hi,

I use the API for reading DA but I have a little problem.
On most servers DA run on http but there are a few wich use ssl.

The currrent script only read http, when it is used on a ssl server I get an internal server error, when I update the connect to ssl it works.

What I am looking for is that if http does nor respond it automaticly tries http, something like this (code does not work)
PHP:
	$sock->connect($obj->server_ip,2222);
	if (!$sock) { 
			$sock->connect("ssl://".$obj->server_ip,2222); 
			}

As mentioned this does not work but could someone give me a code which does the sames which I easily can use in my current script?
 
Back
Top