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