How to read response from Https urls?
<p>Hi
I am using following code to retrieve response code from https based urls, but when i run a prog it just hangs cont. </p>

<p>code:</p>

<pre><code>import java.net.;
import javax.net.ssl.;
import java.io.*;

class Https2
{
    public static void main(String args[]) throws Exception
    {
        URL u = new URL("https://myurl");
        HttpsURLConnection hc = (HttpsURLConnection)u.openConnection();
        hc.setConnectTimeout(3000);
        hc.setReadTimeout(5000);
        System.out.println("Response Code: " + hc.getResponseCode());
        hc.disconnect();
    }
}
</code></pre>

<p>How can make successfull connection to Https urls ?</p>

<p>any help or ideas will be well appreciated.</p>

<p>Thanks</p>
