1

I want to connect to a RESTFul web service which uses SSL certificate authentication. When i use the same url in my browser, it works. But when i write a code in java it does not, not sure what am i missing? looks like i am not passing certificate, are there any inbuilt apis which can do that for me? Below is my code,

URL url = new URL("SomeURL");
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json")

con.getResponseCode();// Timesout
Dipak Rade
  • 11
  • 1
  • possible duplicate of [HttpsURLConnection: Connection Timed out error](http://stackoverflow.com/questions/16895762/httpsurlconnection-connection-timed-out-error) – Angelo Fuchs Dec 09 '14 at 09:41

0 Answers0