Home / Acmefyer / Tomcat certificate

AcmefyerAgent-based Certificate Manager

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.

01By handWhat every replacement involves

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.
02With AcmefyerWhat the agent takes care of

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.xml or 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.
03SetupSet up once, then it runs on its own
  1. 01

    Add a domain

    For example app.example.com, with Let’s Encrypt and validation via HTTP-01 or DNS-01.

  2. 02

    Install the agent

    Run the setup package on the Tomcat server. The agent detects Tomcat and its keystore.

  3. 03

    Create the deployment

    One click accepts the suggestion with path, alias and the file for the password.

  4. 04

    Done

    From now on Acmefyer renews the certificate in time and reports every result.

04FAQFrequently asked questions about Tomcat certificates

Does Let’s Encrypt work with Tomcat?

Yes. Tomcat takes any certificate that sits with its chain and key in the connector’s keystore. Let’s Encrypt issues it for free via ACME, and Acmefyer writes the keystore and restarts Tomcat.

JKS or PKCS#12: which format does Acmefyer write?

Both. What counts is the file the connector names: for the endings .jks and .keystore the agent writes JKS, otherwise PKCS#12.

Where is the keystore password kept?

Where it already is: in 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?

In many cases yes. On Windows the agent also finds Tomcat through the service that starts it, and restarts it through that service. If a product writes the configuration of its web server itself, the scan marks it as managed by the vendor and suggests nothing.

Does Tomcat then also trust certificates from our internal CA?

That is a different store. The keystore holds Tomcat’s own certificate. Which other certificates Java trusts is kept in the trust store cacerts, and Acmefyer does not change that one.