I'm trying, in java, to connect to a HTTPS endpoint. The server's certificate is signed by an internal CA. (not included in the truststore). Because of that, connection fails as expected
How can I inspect a certificate from a https server before the connection is made (in java). I need to view it to know what CA certificate I need to import.
I can do this using openssl like so
openssl s_client -connect www.paypal.com:443
But I would like to do this from Java
Thanks!