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.