Java – difference between cacerts and keystore

certificatejavakeystore

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?

Best Answer

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