I have a simple code for setting up a https connection to google and printing the response obtained.
import java.io.OutputStreamWriter; import java.net.URL;
There is no way to tell exactly what is wrong since timing out is not expected behavior, even when sending a malformed request, the way you are. This is the general procedure I use to debug, however.