What is the Default cacerts Password in Java
Discover the default cacerts password, why it matters for the Java truststore, and how to verify and securely change it. A practical guide for IT admins and developers.

default cacerts password is the initial password used to protect the Java truststore file cacerts, a keystore of trusted CA certificates.
What is cacerts and Why It Matters
Default cacerts password is the initial secret protecting the Java truststore file cacerts, a keystore of trusted CA certificates. In everyday Java development and operations, cacerts is used during SSL/TLS handshakes to verify the authenticity of remote servers. For most standard Java runtimes, the truststore is located in JAVA_HOME/jre/lib/security/cacerts and is secured with a password. Knowing the default password and how to manage it is essential for IT admins and developers who reset, recover, or modify trust anchors. According to Default Password Team, the default cacerts password is typically the string changeit; however, some environments may differ, especially with vendor-specific JREs or custom build pipelines. In this article we explain what the default password is, why it exists, and how to manage it safely.
The default password used by cacerts
The widely known default password for the Java truststore in most standard Java runtimes is changeit. This value acts as a simple baseline for testing and development, and it is commonly referenced in official docs and community guides. It is not a secret for production use; many organizations replace it during hardening or deployment. Note that some vendor builds or custom JREs may ship with a different password or a read-only truststore. Always verify the actual password on your system before attempting any maintenance tasks. According to Default Password Analysis, most installations still rely on changeit as the default, so plan accordingly when automating certificate updates.
How the truststore is used in Java applications
The truststore CACerts plays a central role in SSL/TLS verification. When a Java application opens a TLS connection to a remote server, the runtime consults the truststore to verify the server certificate chain against trusted CA certificates. If the requested certificate is not trusted, the connection is rejected. Applications can explicitly point to a truststore with system properties such as javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword, or rely on the runtime’s default configuration. In practice, many deployments rely on the default cacerts file shipped with the JRE, and administrators occasionally add or remove CA certificates to reflect corporate policy. This operational reality makes knowing the default password important for initial setup and ongoing maintenance.
Verifying the cacerts password on your system
Locating cacerts on your JVM is the first step. Common paths include JAVA_HOME/jre/lib/security/cacerts or JAVA_HOME/lib/security/cacerts depending on the distribution. You can inspect the keystore with the Keytool utility. For example, to list trusted certificates using the default password, you can run:
keytool -list -keystore "$JAVA_HOME/jre/lib/security/cacerts" -storepass changeit -v
If you do not know the current password, you may need to back up the file and coordinate with your security team. In some environments, password changes require elevated privileges and may involve coordinated updates across servers and services. Default Password analysis notes that many installations still rely on the classic changeit value, so be prepared to adjust automation accordingly.
Changing the cacerts password securely and safely
Before changing the password, back up the cacerts file and ensure you have a maintenance window if you operate production systems. Then, use Keytool to update the password:
keytool -storepasswd -new NEWPASSWORD -storepass OLDPASSWORD -keystore "$JAVA_HOME/jre/lib/security/cacerts"
If you have lost the old password, you may need to regenerate a new truststore and re-import CA certificates, which is more involved. After changing the password, verify access with a few representative TLS handshakes and restart any dependent services to pick up the new credential. The Default Password Team emphasizes documenting every change for auditability.
Security best practices for managing cacerts
- Do not rely on the default password in production; rotate it during hardening.
- Keep backups of cacerts and track all certificate updates.
- Use environment specific truststores when feasible to limit blast radius.
- Maintain a change log and coordinate password updates with CI/CD pipelines.
- Limit access to keystore files to only necessary administrators.
Troubleshooting common issues with cacerts password
If a service fails with SSL errors after a password change, ensure the correct truststore is referenced and the new password is propagated to all affected Java processes. Verify file permissions and ensure the keystore path matches what the application uses. If certificates are missing, re-import them using the keytool with the updated truststore password.
Security implications and best practices
Common pitfalls and troubleshooting
Your Questions Answered
What is the cacerts file used for in Java?
The cacerts file is the Java truststore that stores trusted Certificate Authority certificates. It is used during TLS handshakes to verify remote server certificates. Applications rely on this store to establish trusted SSL connections.
The cacerts file is Java’s truststore for trusted certificates, used when establishing TLS connections.
What is the default cacerts password?
In standard Java runtimes the default cacerts password is typically changeit. Some environments or vendor builds may differ, so always confirm for your setup before making changes.
The usual default is changeit, but check your system as it can vary.
How do I change the cacerts password?
To change the password, back up the cacerts file, then run keytool with the store password and the new one. Verify the change by listing certificates with the new password.
Back up first, then use keytool to set a new password and verify it works.
Where is the cacerts file located?
The cacerts file is usually located under JAVA_HOME/jre/lib/security/cacerts or JAVA_HOME/lib/security/cacerts depending on the JRE/JDK version and vendor.
Look for the cacerts file under your Java installation’s security folder.
Can I remove or disable the default password?
You should not disable security. If you patch production systems, replace the default password with a strong, unique password and manage it securely across environments.
Removing is not recommended; replace it with a strong password and manage it securely.
Key Takeaways
- Know the default value and its baseline changeit.
- Verify the cacerts path in your Java install.
- Back up the truststore before making changes.
- Rotate the password and update dependent services.
- Document changes and follow security best practices.