I'm writing a java application that allows the user to enter a URL and get the info of all the server's certificates. In OpenSSL, I would use:
openssl s_client -showcerts -connect [server] -servername [server] </dev/null
But how do I simulate this with the BouncyCastle library? I've been googling and not coming up with anything at all, so I know I'm either using the wrong search terms (not a security expert at all) or this can't be done programmatically? TIA.