Home / Acmefyer / Tomcat certificate
Renew Tomcat certificates automatically, keystore included.
Tomcat and many Java applications do not read their certificate as a PEM file but from a Java keystore with a password and an alias. Every replacement means rebuilding the keystore and restarting Tomcat. Acmefyer obtains the certificate via ACME, for example for free from Let’s Encrypt, and an agent writes the keystore the way the connector expects it.
How to replace the SSL certificate in the Tomcat keystore by hand.
Certificate, chain and key are combined into a keystore, for example with OpenSSL as a PKCS#12 file:
openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -name tomcat -out keystore.p12
File, password and alias have to match what the connector names in server.xml (certificateKeystoreFile, certificateKeystorePassword, certificateKeyAlias). Tomcat then restarts. If the application expects the older JKS format, a conversion with keytool is added.
- Format
- PKCS#12 or JKS, with the connector’s password and alias. One typo, and Tomcat starts without HTTPS or not at all.
- Bundled
- Many products bring a Tomcat of their own, on Windows often as a service with its own name. The keystore then sits somewhere in the product’s folder.
- How often
- Since March 2026 public certificates are valid for at most 200 days, from 2029 for only 47 days. The replacement is then due roughly every month.
The agent writes the keystore and restarts Tomcat.
The Acmefyer server obtains the certificate from Let’s Encrypt or another ACME certificate authority and renews it about 30 days before expiry. The Acmefyer agent runs as a service on the Tomcat server, on Windows as well as on Linux. It picks up the new certificate, writes it as a Java keystore with the connector’s password and alias and restarts Tomcat.
The keystore password does not have to be stored in Acmefyer for this: the agent reads it from server.xml at every deployment. That way it never leaves the system.
- Keystore
- PKCS#12, or the JKS format for files ending in .jks or .keystore. Certificate, chain and key under the connector’s alias.
- Password
- Read from
server.xmlor stored in the deployment. The agent does not read placeholders such as${…}. In that case you enter the password yourself. - Detection
- The agent finds Tomcat with its connector, keystore and the certificate currently in place and suggests the matching deployment. On Windows also where a product brings a Tomcat of its own as a service.
- Restart
- Through the service that starts Tomcat. The new certificate takes effect after the restart.
- Relatives
- The enaio gateway as well: its keystore is replaced as with Tomcat, with a restart of the service.
- Validation
- With DNS-01 the Tomcat server does not have to be reachable from the internet for the domain validation.
- 01
Add a domain
For example app.example.com, with Let’s Encrypt and validation via HTTP-01 or DNS-01.
- 02
Install the agent
Run the setup package on the Tomcat server. The agent detects Tomcat and its keystore.
- 03
Create the deployment
One click accepts the suggestion with path, alias and the file for the password.
- 04
Done
From now on Acmefyer renews the certificate in time and reports every result.
Does Let’s Encrypt work with Tomcat?
JKS or PKCS#12: which format does Acmefyer write?
Where is the keystore password kept?
server.xml. The agent reads it from there at every deployment, and it is not sent to the Acmefyer server. Alternatively you enter it in the deployment. Acmefyer then stores it encrypted.Our product ships a Tomcat of its own. Does that work too?
Does Tomcat then also trust certificates from our internal CA?
cacerts, and Acmefyer does not change that one.