views:

27

answers:

1

Hi, I need to connect to a server from an environment with a SSL proxy on, is it possible to handle that environment using just sockets? Is it was a no-SSL proxy, would that be possible?

Thank you very much.

A: 

If I understand correctly, you want to connect to a non-http tcp socket through a http/https proxy.

That is possible, you just connect to the http proxy, and send:

CONNECT hostname.com:portnumber HTTP/1.0

wait for a success response, and then you are connected to the external server and can send/receive data as normal.

However, many http proxies are configured to only allow you to connect to a limited number of ports, so if the server you want to connect to is not running on the standard https tcp port (443) your connection might be denied.

If the proxy does not allow https, it is unlikely to allow the CONNECT method. In that case your only choice would be to talk to a http server outside the proxy, which converts to/from the final protocol you want to speak.

It might be handy if you state exactly what protocols the proxy and server are using, as people could give more specific advice then.

JosephH