0

I have the server running which listens on HTTPs protocol. This server is running on tomcat 9. I have the certificate file on local and also have the password for it. I am trying to hit a URL of this server with HttpsURLConnection class. How can I pass certificate information to get successfully connected to the server?

I am able to successfully connect to the server if the server runs on HTTP protocol with HttpURLConnection. But with the secured connection I got "java.security.cert.CertificateException" and "javax.net.ssl.SSLHandshakeException" exception.

Dhaval Goti
  • 447
  • 2
  • 10
  • 25
  • Are you using self signed certificate? Two you need to do two way SSL Handshake? Meaning client must be recognized by server? – Red Boy Jun 01 '18 at 09:53
  • Yes. I am using self signed certificate. I have tried from https://stackoverflow.com/questions/3734613/how-to-request-a-url-that-requires-a-client-certificate-for-authentication. But still error came. – Dhaval Goti Jun 01 '18 at 09:59

0 Answers0