Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With the same url, this ends up giving a verify return code 20 (unable to get local issuer of certificate):

openssl s_client -connect $URL:443 -showcerts -CAfile /etc/ssl/certs/java/cacerts

This gives a verify return code of 0:

openssl s_client -connect $URL:443 -showcerts -CApath /etc/ssl/certs

As does ... -CAfile /etc/ssl/certs/Thawte_Premium_Server_CA.pem.

But that cert is already in the java keystore. I need to be able to access the url from Java-land and I can't figure out what's going on. I'm a total n00b here so any help would be appreciated.

share|improve this question

Tha cacerts file is a JKS-format keystore, which OpenSSL doesn't support (it's the standard keystore format for Java, but isn't commonly supported by non-Java utilities)

If you want to use openssl s_client with the certs from that keystore, you can extract them into a usable form with

keytool -list -rfc -keystore /etc/ssl/certs/java/cacerts > cacerts.pem

(the default password for the cacerts file is "changeit", but if you just want to see the public certs you can just enter a blank password and it will be fine)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.