0

I have a very basic java webservice call...

public static String contactWebservice(){
      DefaultHttpClient httpclient = new DefaultHttpClient();
      HttpHost target = new HttpHost(“www.someurl.com”, 443, "https");
      HttpGet getRequest = new HttpGet("PARAMETERS FOR WEBSERVICE");
      HttpResponse httpResponse = httpclient.execute(target, getRequest);
      …more code...

I need to turn this into a SSL call without a cert. Much like a browser contacts an ssl secured webpage and gets data back without having a cert. I've tried many different methods but nothing has worked so far. I keep getting "peer not authenticated" errors.

Joshua Hedges
  • 307
  • 4
  • 16
  • Hope it helps : [https://stackoverflow.com/questions/2893819/accept-servers-self-signed-ssl-certificate-in-java-client](https://stackoverflow.com/questions/2893819/accept-servers-self-signed-ssl-certificate-in-java-client) – urs_ng Sep 18 '18 at 17:39
  • Some webservices will require certificate based authentication and authorization. Thus you will need an SSL certificate. Check with the provider of the service if this is the case. I suspect this is the case as it says peer not authenticated. Check with the provider but I suspect you will need to get a client certificate issued to your program. This is where you use two certificates to identify each other and secure transmissions. Check https://www.google.com.au/search?q=certificate+based+authentication+java for some articles – Namphibian Sep 18 '18 at 22:15

0 Answers0