Automate certificate renewal on Apache Tomcat

Tomcat can reload a renewed TLS certificate without a restart, so renewal depends on an external process such as certbot writing the files and Tomcat being told to reload them. Shorter public lifetimes make that pipeline a requirement rather than a convenience.

On this page

How can Tomcat certificate renewal be automated, and what do shorter lifetimes change?

Today the Java application team renews a Tomcat certificate by hand, running a keytool import into the keystore every time a new certificate arrives. That manual step will not scale as public certificate lifetimes shrink. Tomcat can reload a renewed certificate without a restart through the TLSCertificateReloadListener or the Manager sslReload command, but neither one renews anything. An external process such as certbot must obtain the new certificate and place it where Tomcat reads it, and shorter lifetimes make that pipeline necessary rather than optional.

Three groups have to act. The Java application team owns the connector configuration in server.xml and decides whether the listener or the Manager command will trigger the reload. The platform team owns certbot or the certificate authority integration, including the ACME account, the renewal schedule and the deploy hook that hands the new files to Tomcat. Whoever owns the keystore format and file locations must confirm that the files certbot writes match what Tomcat expects, since Tomcat operates only on JKS, PKCS11 or PKCS12 keystores, and that the paths are readable by the Tomcat process.

The Baseline Requirements set the public maximum at 200 days from 15 March 2026, 100 days from 15 March 2027 and 47 days from 15 March 2029, so each renewal happens more often than the last. Let's Encrypt has published its own move to 45-day certificates, and it recommends ACME Renewal Information and monitoring over manual renewal. Confirm with the vendor documentation which renewal trigger each Tomcat version supports before you choose one.

What the 200-day, 100-day and 47-day limits mean for Tomcat renewals

This table sets the CA/Browser Forum maximum validity and validation reuse limits against the Let's Encrypt timeline for each step. Read each row as one step, then check what your manual Tomcat keystore import process would need to absorb at that point.

StepMaximum validity and validation reuseApproximate renewals a yearWhat stops working by hand
Until 14 March 2026Maximum validity of 398 days under the earlier rulesFewer renewals a year, so a manual import may still be tolerableLittle changes yet, but teams should inventory keystores and renewal steps now
From 15 March 2026Maximum validity of 200 days; domain and IP validation reuse of 200 daysMore renewals than before, but still a small number a yearManual keystore imports that are only done once a year start to fall behind
From 15 March 2027Maximum validity of 100 days; domain and IP validation reuse of 100 daysSeveral renewals a year, so renewals become a recurring taskAny renewal that depends on a person remembering to import a new certificate
From 15 March 2029Maximum validity of 47 days; domain and IP validation reuse of 10 daysMany renewals a year, so renewal must be fully automatedAny manual keystore import, and any reload that needs a full Tomcat restart
Let's Encrypt, 13 May 2026Opt-in tlsserver ACME profile issues 45-day certificatesOptional profile for testing before the default changesHardcoded renewal intervals sized for 90-day certificates
Let's Encrypt, 10 February 2027Default classic profile issues 64-day certificates; authorization reuse of 10 daysRenewal frequency rises from the current 90-day defaultManual renewal, and fixed 60-day renewal schedules
Let's Encrypt, 16 February 2028Classic profile issues 45-day certificates; authorization reuse of 7 hoursRenewal becomes frequent enough that automation is requiredAny renewal process without monitoring for failed renewals

How Tomcat picks up a renewed certificate

Tomcat reads its TLS certificate from the nested Certificate element of an HTTP connector, and that element accepts one of two alternatives. The certificateFile attribute points to a certificate in PEM format, and certificateKeystoreFile points to a keystore. Each is required unless the other is specified. If you use a keystore, certificateKeystoreType selects its format. When it is unset, Tomcat uses the javax.net.ssl.keyStoreType system property, and if that is also unset, it falls back to JKS. Tomcat supports three keystore formats: JKS, PKCS11 and PKCS12. Confirm which format your Tomcat version and key provider expect before you rely on a given type.

If your renewal process produces PEM files, you can convert them to a PKCS12 keystore. The Tomcat SSL how-to gives an openssl pkcs12 -export command that takes the certificate, private key and CA file and writes a PKCS12 file with the tomcat alias and the -chain option. Keep the key and keystore permissions tight, and check the alias in the output file, because a reload serves whichever certificate the configured alias selects. The how-to also notes that with a configured alias, the reload does not pick a different alias or prefer a later-expiring certificate. For a key manager not wrapped by Tomcat, such as one from a FIPS provider, certificateKeyAlias must name the served certificate.

Tomcat does not renew certificates on its own. The TLSCertificateReloadListener class, org.apache.catalina.security.TLSCertificateReloadListener, reloads a certificate that an external process has already renewed, without a restart. It must be nested only within the Server element. It does not renew the certificate and does not re-read server.xml, so a separate process such as certbot has to perform the renewal and write the new files. The listener's checkPeriod defaults to 86400 seconds and its daysBefore defaults to 14, which is the number of days before expiry by which the new certificate is expected to be in place. Check those values against your renewal schedule, since a 47-day certificate leaves little room if the window is wrong. The Tomcat Manager sslReload command offers another way to trigger a reload without re-parsing server.xml.

Which ways to automate Tomcat renewal the sources describe

An external ACME client such as certbot renews the certificate and writes it to PEM or PKCS12 files on disk. Tomcat then picks up the new files through the TLSCertificateReloadListener, which checks for changes on its checkPeriod and loads the renewed certificate without a restart. The listener does not perform the renewal itself and does not re-read server.xml, so the ACME client must run on its own schedule and deliver the files to the path Tomcat reads.

  • Listener placement: The org.apache.catalina.security.TLSCertificateReloadListener must be nested only within a Server element in server.xml.
  • Check period: The checkPeriod defaults to 86400 seconds, and daysBefore defaults to 14, the number of days before expiry by which the new certificate is expected to be in place.
  • Connector attributes: Use certificateFile for PEM input or certificateKeystoreFile for a keystore. Each is required unless the other is set, and certificateKeystoreType falls back to the javax.net.ssl.keyStoreType property, then to JKS.
  • Alias handling: With a configured alias, the reload does not select a different alias or prefer a later-expiring certificate. Where the key manager is not wrapped by Tomcat, such as one from a FIPS provider, certificateKeyAlias must identify the served certificate.
  • Hooks: Certbot's --deploy-hook runs only after a successful renewal, so the copy step into Tomcat's files belongs in a deploy hook.

Check that renewal runs well before expiry and that the listener's daysBefore value agrees with your renewal window.

Setting up automated Tomcat renewal in order

This sequence takes a Tomcat connector from a manually imported certificate to one that picks up a renewed certificate from disk without a restart. Each step builds on the previous one, so the renewal process and the reload trigger can be tested end to end before the 47-day schedule applies.

  1. Confirm the keystore type is supported

    Check which keystore format your Tomcat instance uses before changing anything. Tomcat operates only on JKS, PKCS11 or PKCS12 keystores, so any other format must be converted first. If the certificateKeystoreType attribute is not set on the connector, Tomcat uses the javax.net.ssl.keyStoreType system property and falls back to JKS if that is also unset, so confirm the effective type on your instance. The step is done when you can name the keystore type in use and confirm it is one of the three supported formats.

  2. Choose PEM or keystore for the connector

    Decide whether the connector reads a PEM certificate file or a keystore, because the two are alternative attributes of the nested Certificate element. Set certificateFile for PEM format, or set certificateKeystoreFile for a keystore, and make sure one of them is specified. Pointing the connector at the same file paths that your renewal process writes to lets the renewed certificate be picked up later. The step is done when the connector configuration names exactly one of these attributes and the path is one your renewal process can write to.

  3. Build the PKCS12 file if needed

    If you are working from a PEM certificate and key rather than an existing keystore, build a PKCS12 file with openssl. The Tomcat SSL how-to documents the command openssl pkcs12 -export -in mycert.crt -inkey mykey.key -out mycert.p12 -name tomcat -CAfile myCA.crt -caname root -chain, which packages the certificate, key and chain into one file. Substitute your own file names and alias, and confirm the alias matches what your connector expects. The step is done when the PKCS12 file exists at the path your configuration references and opens without errors when inspected.

  4. Add the reload listener to the Server element

    Nest the org.apache.catalina.security.TLSCertificateReloadListener element inside the Server element in server.xml, since the listener is only valid there. Set checkPeriod to control how often Tomcat checks for a changed certificate, and set daysBefore to the number of days before expiry by which the new certificate is expected to be in place. The documented defaults are 86400 seconds for checkPeriod and 14 days for daysBefore, so set these deliberately if your renewal window differs. The step is done when the listener appears in the Server element and the values match your renewal schedule.

  5. Run the renewal process and deploy files

    Set up a separate renewal process, such as certbot, because the listener does not renew certificates and does not re-read server.xml. Configure the process to write the renewed certificate and key to the same file paths the connector uses, typically through a deploy hook. Certbot runs deploy hooks only after a successful renewal, so the hook can copy or rebuild the files at the right moment. The step is done when a test renewal writes updated files to the configured paths and the hook completes without error.

  6. Trigger the reload with sslReload or the listener

    After the renewed files are in place, reload the TLS configuration without restarting Tomcat. You can rely on the listener to detect the change at its next check, or call the Manager text interface command to reload immediately. Omit tlsHostName to reload all hosts. Note that after other configuration changes, such as edits to server.xml, a restart is still required as you normally do. If you use a FIPS key manager not wrapped by Tomcat, certificateKeyAlias must identify the served certificate, because the reload does not select a different alias. The step is done when the reload has run and the connector serves the new certificate.

  7. Verify the reload response and certificate

    Confirm that the reload succeeded and that the connector is serving the renewed certificate. A successful sslReload call returns a response such as OK - Reloaded TLS configuration for [_default_], so check for that message. Then inspect the certificate presented on the connector port and compare its expiry date with the renewed file. The step is done when the response matches the documented success message and the served certificate has the new expiry date. Repeat the check after each renewal cycle to confirm the process still works.

What must be in place before Tomcat renewal is automated

Automated renewal on Tomcat depends on a few components lining up: a Tomcat version with the reload support, a renewal client that can hand off new files, a keystore or PEM path the process can write to, and a reload path that is locked down. Check each item below before you wire the pieces together, because a gap in any one of them leaves you with a certificate that renews on disk but never reaches the connector.

A Tomcat version with TLS reload support

The TLSCertificateReloadListener and the Manager sslReload command are documented for Tomcat 11, and the sources supporting this page use the Tomcat 11 documentation. Confirm the exact version your servers run and check its documentation before you plan around these features, because older releases may not include them. The listener loads a renewed certificate without a restart, so without it you fall back to restarting Tomcat after each renewal. Write down the version in use so the automation and the documentation you follow match.

Tomcat SSL how-to

A renewal process with deploy hook behavior

The Tomcat listener does not renew certificates, so a separate process such as certbot must perform the renewal and write the new files. Certbot's --deploy-hook runs only after a successful renewal, which is the point where you copy or convert the certificate for Tomcat and trigger the reload. Set the hook to fail visibly if the copy or reload fails, so a broken deployment does not go unnoticed. Confirm which Certbot version you run, since post-renewal hook arguments changed in 2.7.0.

Certbot user guide

Network reachability for ACME validation

An ACME client has to prove control of each domain before a certificate is issued, and the validation method you choose determines what must be reachable. HTTP-01 needs the validation path served over port 80, while DNS-01 needs the ability to create records in the zone. Test reachability from the public internet or from the validation path your CA uses, not only from inside your network. A renewal that fails validation will show up as an expired certificate on the connector, so verify this before the first automated run.

Write access and key storage permissions

The renewal process must be able to write new certificate and key files to the keystore or PEM paths the connector reads. Give that process write access only to the directory it needs, and make the private key readable only by the Tomcat service account and the renewal job. Loose permissions on a key file are a common finding in review, and so is a renewal user that can read keys it has no reason to see. Record the paths and owners in your runbook so the renewal and the connector point at the same files.

Manager application enabled with restricted sslReload access

The sslReload command is served by the Manager application, which must be deployed and enabled before the renewal job can call it. Restrict access to the Manager to the host or network the renewal job runs from, and use a dedicated account with only the role needed for this command. Leaving the Manager open to broad networks exposes a management interface on a production server. Confirm the access rules in the Manager documentation before you write the renewal hook that calls it.

Tomcat Manager how-to

Keystore type set on the connector

The connector uses the certificateKeystoreType attribute to read the keystore format, and Tomcat supports JKS, PKCS11 and PKCS12 keystores. If the attribute is unset, Tomcat uses the javax.net.ssl.keyStoreType system property and falls back to JKS when that is also unset. Set the type explicitly so a change in system properties cannot silently change how the connector reads the file. Match the type your renewal step writes, whether that is a PKCS12 file built with openssl or a PEM pair referenced by certificateFile.

Tomcat HTTP connector

How to confirm Tomcat renewals keep happening

Renewal on Tomcat is only useful if you can show it kept happening, so the sources' guidance is to alert when a certificate is not renewed when expected and not to rely on manual renewal. Lifetimes are shrinking: the CA/Browser Forum sets a 200-day maximum from 15 March 2026, 100 days from 15 March 2027 and 47 days from 15 March 2029, and Let's Encrypt's published timeline moves its default to 45-day certificates from 16 February 2028. At those lengths a missed renewal surfaces quickly, so the check should run from outside the server, against the certificate the public actually sees. Query the served certificate's expiry over TLS on the connector's port on a schedule, and alert when the remaining lifetime drops below your threshold, which should sit comfortably above the daysBefore value of 14 that the reload listener uses by default.

Confirm the reload as well as the renewal. After certbot or another client writes new files, the Tomcat Manager text interface command sslReload?tlsHostName=name should return a response such as OK - Reloaded TLS configuration for [_default_]. Treat any other response as a failed reload, and check it in your automation rather than assuming the listener picked up the file. Certbot can help with alerting: from Certbot 2.7.0, post-renewal hooks receive RENEWED_DOMAINS and FAILED_DOMAINS as space-separated lists, so a hook can notify your team when FAILED_DOMAINS is non-empty. Deploy hooks run only after a successful renewal, so a failed renewal will not trigger the reload hook, and that absence is itself a signal your monitoring should catch.

Keep a record of each renewal event: the domain, the old and new expiry dates, the time of the reload response and any failure. An auditor or customer may ask for this history, and a log of successful renewals across the lifetime of the certificate is much easier to produce when it is kept as it happens. The sources do not prescribe a retention period or log format, so confirm those requirements with your compliance and vendor-risk teams. Finally, test the whole chain before the shorter lifetimes arrive by forcing a renewal in a non-production environment, confirming the sslReload response and checking the served expiry from outside the server.

How a renewal flows from the CA to Tomcat's served certificate

Renewal starts with an ACME client such as certbot, which obtains a new certificate from the certificate authority and writes PEM or PKCS12 files to disk. A deploy hook runs only after that renewal succeeds and can update the keystore that Tomcat reads. The TLSCertificateReloadListener then checks the files on its checkPeriod or the Manager sslReload command is called, reloading the certificate without a restart. Check that the monitoring step alerts the team when a renewal or reload fails, because the listener does not renew anything itself.

The renewal path from the CA through the deploy hook to Tomcat's reloaded certificate, with monitoring for failures.

How DeployOpen helps teams automate Tomcat and TLS renewal

DeployOpen plans and builds automated certificate renewal for Apache Tomcat in your own infrastructure, starting from how your connectors and keystores are configured today. The work covers the renewal process, the reload path into Tomcat, and the monitoring that tells your team when a renewal did not happen.

How we scope

  • We inventory each Tomcat connector, keystore and certificate file, and record whether it uses JKS, PKCS11 or PKCS12 storage.
  • We confirm which renewal source applies to each certificate, whether an ACME client, an internal CA or a manual process.
  • The written scope lists the Tomcat instances, connectors and renewal paths covered, and is agreed before any work starts.

How we build

  • We set up the renewal process to write new key material to the path Tomcat reads, using the file or keystore format your version supports.
  • We configure the reload path, such as the TLSCertificateReloadListener or the Manager sslReload command, and test it without a full restart.
  • We test renewal in a staging environment, including a forced renewal and a check that the served certificate matches the new one.

How we hand over

  • We document each connector, keystore path, renewal schedule and reload step so your platform team can run and audit the process.
  • We set up alerting on renewal failures and on certificates approaching expiry, and document the response steps for each alert.
  • We walk your team through a live renewal and the troubleshooting steps, and record the final configuration in the handover pack.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, covering changes to Tomcat versions and connectors.
  • We can re-test renewal after a Tomcat upgrade, a change to the certificate authority, or a change to the lifetime your CA issues.
  • Support covers the renewal path and reload behavior, and we confirm compatibility with your Tomcat version before any change goes live.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.