I am working with a vendor's appliance, and they use the default Java cacert for adding certs for allowing self-signed certs. When working on this process, I noticed that the cacert uses the default password changeit
For increased security, I would like to change the cacert password. Instructions are online. However, I am worried that once I change the password applications using cacert will stop functioning correctly.
I realize I don't really understand how Java is accessing cacert.
- Does it need the
cacertpassword? - Does anything need the
cacertpassword? - Or do you only need the
cacertpassword when adding or removing certs?
First of all, it's
cacertswith an 's' at the end, notcacert. The password is only needed to modify the file, and that included adding or removing certificates. You don't need the password to use this file, though if you do supply a password it will be used to verify the integrity of the file.Java by default uses
cacertswhen verifying certificate chains and by default it does not use a password. Even though the JDK ships thecacertsfile protected with the passwordchangeitthe Java runtime does not assume this. You can change the default behavior in a few ways, the simplest of which is to set the Java system propertyjavax.net.ssl.trustStorePasswordto the password. There is also a Java system propertyjavax.net.ssl.trustStorethat can be used to point to a file you want to use in place ofcacerts. Using these tools you can, all optionally and independently:cacertsfile.cacerts.There is one obvious caveat that needs to be mentioned nevertheless. You say this is a vendor's appliance. That means the Java environment may have already been customized. Perhaps there is already code there that assumes the
cacertspassword ischangeit. You did ask if anything uses thecacertspassword.The above is really just a summary, the full story is documented in the JSSE Reference Guide. One particularly relevant section to your question I'll reproduce here: