What is difference between cacerts and keystore?

JavaCertificateKeystore

Java Problem Overview


What's the difference between the two, cacerts and keystore?

If I use the definition found in these links, cacerts and keystore, it seems that they're a collection of certificates, but in context of a (Java) distributed system. Which one is used to authenticate during an SSL connection? Both or just one of them or alternate?

Java Solutions


Solution 1 - Java

'cacerts' is a truststore. A trust store is used to authenticate peers. A keystore is used to authenticate yourself.

Solution 2 - Java

cacerts is where Java stores public certificates of root CAs. Java uses cacerts to authenticate the servers.

Keystore is where Java stores the private keys of the clients so that it can share it to the server when the server requests client authentication.

Solution 3 - Java

Cacerts are details of trusted signing authorities who can issue certs. This what most of the browsers have due to which certs determined to be authentic.

Keystore has your service related certs to authenticate clients.

Solution 4 - Java

Check your JAVA_HOME path. As systems looks for a java.policy file which is located in JAVA_HOME/jre/lib/security. Your JAVA_HOME should always be ../JAVA/JDK.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiondimasView Question on Stackoverflow
Solution 1 - Javauser207421View Answer on Stackoverflow
Solution 2 - JavaAravind YarramView Answer on Stackoverflow
Solution 3 - JavaJawedView Answer on Stackoverflow
Solution 4 - Javanaveen vermaView Answer on Stackoverflow