Problem : I want to consume the HTTPS Restful Webservice by using jersey client.
1) I got CARoot certificate from the 3rd party and installed on browser (Mozilla) and i am able to access these services from RestClient on Mozilla browser.
i) RootCA.pem ii) SubCA-Client.pem iii) abc_sdsdllkl_p12.pfx
2) I want to configure this Webservice in JAVA code by using jersey client.
3) What are the steps i have to do to configure these certificates in java code.
4) I don't want to configure these in local JRE.
PAttributes pd = new PAttributes();
ClassLoader classLoader = pd.getClass().getClassLoader();
File file = new File(classLoader.getResource("cacerts").getFile());
System.setProperty("javax.net.ssl.trustStore",file.getAbsolutePath());
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
Client client = Client.create();
WebResource webResource = client.resource("https://xyz/abc/getAttributes");
String input = new PAttributes().getRequestBody();
ClientResponse clientResponse = webResource.accept("application/xml").type("application/xml").post(ClientResponse.class, input);
String output = clientResponse.getEntity(String.class);
System.out.println("output"+output);
I have downloaded the .crt files from browser and need to configure, don't know how ?