title: URLConnection.connect() throws a SSLKeyException for HTTPS in Eclipse
body: <p>I am testing a simple method which works fine for images with the HTTP protocol, but fails for HTTPS images ONLY in eclipse. I tested in other IDEs such as DrJava and jCreator but they work fine in them. The method is as follows. </p>
  
  <p>When called as follows, an exception is thrown</p>
  
  <pre><code>boolean verify = verifyImage("https://www.eff.org/files/HTTPS_Everywhere_new_logo.jpg");
  System.out.println("Verify result is : " + verify);
  </code></pre>
  
  <p>The exception details are as follows.</p>
  
  <pre><code>javax.net.ssl.SSLKeyException: RSA premaster secret error
  java.security.NoSuchAlgorithmException: SunTlsRsaPremasterSecret KeyGenerator not available
  </code></pre>
  
  <p>The method is as follows</p>
  
  <pre><code>public static boolean verifyImage(String src)
   {
    HttpURLConnection urlConnection = null;
    try {
     URL url = new URL(src);
     urlConnection = (HttpURLConnection) url.openConnection();
     urlConnection.setRequestMethod("HEAD");       
     urlConnection.connect();
     if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_OK) {
       return true;
  
      } else {
       return false;
      }
    } catch (Exception e) {
     System.out.println("Exception");
     return false;
    }
   }    
  </code></pre>
  
  <p>Any help to resolve the issue would be highly appreciated. </p>
  
  <p>P.S: I tried using javax.net.ssl.HttpsURLConnection which results in the same exception.</p>