Skip to content

IGNITE-29212 Reload HTTP REST certificates from the Jetty configuration - #13874

Open
anton-vinogradov wants to merge 6 commits into
apache:masterfrom
anton-vinogradov:ignite-29212-jetty
Open

anton-vinogradov wants to merge 6 commits into
apache:masterfrom
anton-vinogradov:ignite-29212-jetty

Conversation

@anton-vinogradov

@anton-vinogradov anton-vinogradov commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

IGNITE-29212 lets operators reload the keys and trusted certificates of the HTTP REST endpoint that Jetty serves over HTTPS, without restarting the node. control.sh --ssl reload and automatic hot reload now cover this endpoint, and hot reload runs for every factory without settings.

Behavior

  • When the Jetty connector serves HTTPS, the node registers its TLS factory as HTTP REST. The reload command and the hourly hot reload check call the factory's reload(...) once per reload. The factory keeps its jetty.xml settings and reads its own source, so standard and custom Jetty factories work the same way.
  • This change updates Jetty to 12.1.15. If loading the replacement fails, Ignite restores the working SSLContext and its key and trust stores before it releases the Jetty factory lock. Jetty selects the certificate for each SNI host from that key store. Recovery works even while the source is unavailable. The next attempt uses the sources configured in jetty.xml, including any stores supplied directly.
  • The hot reload date comes from the key store that new connections use, so it follows replacements that the factory installed by itself, such as by KeyStoreScanner.
  • The SSL factory registry keeps reload operations for each registered factory: an Ignite factory through a small adapter, the Jetty factory as is. The hourly check and the reload command use the registry's entries.
  • The command reports HTTP REST: reloaded, or the node and the cause. Hot reload logs its attempts for HTTP REST and counts them in the ssl metrics, like other transports.
  • If a reload that Ignite did not start, such as one by Jetty's KeyStoreScanner, has left the factory without keys, the command and hot reload report it as a failure. That mechanism recovers the factory once its source is fixed.

Hot reload without settings

  • Hot reload runs for every factory that supports reload. A failed load keeps the previous context, so the node needs no switch to stay safe.
  • A certificate in a private key chain is due before it expires by a third of its lifetime, but by no more than 7 days. A factory is due when its first certificate is due. A fixed 7 days made certificates valid for less than 7 days due right after loading: the node reloaded them and logged a failure every hour. IGNITE-29333 makes the lead time configurable.
  • A node now loads a replaced key store by itself within an hour once its current certificates are due. The documentation presents the trust-first order as the general rule for replacing certificates.

API changes

Removed from AbstractSslContextFactory. None of them has been released. Configurations that set these properties, for example in Spring XML, must drop them:

public static final long DFLT_HOT_RELOAD_BEFORE_EXPIRY_MS
public boolean isHotReloadEnabled()
public void setHotReloadEnabled(boolean enabled)
public long getHotReloadBeforeExpiryMs()
public void setHotReloadBeforeExpiryMs(long millis)

Tests

JettyRestHttpsReloadTest starts a node with HTTPS from Jetty XML and checks the certificate that a new HTTPS client sees:

  • the standard factory, which requires an SNI host name, serves the replacement after the command, and after a failed command it keeps the previous certificate until the corrected file is reloaded;
  • a custom factory serves the certificate that hot reload installed, and keeps it after a failed manual reload;
  • the hot reload date follows a replacement that the factory made by itself and stays after a failed reload;
  • if a trust store file is corrupt, the endpoint keeps its working context. After the file is fixed, a retry uses the new trust store with the keys configured in memory;
  • a successful reload calls the factory's reload(...) once.

The core tests check the new lead time rule and the registry without the hot reload switch.

🤖 Generated with Claude Code

anton-vinogradov and others added 6 commits November 24, 2026 01:08
The reload command and the hourly hot reload check now reload the TLS factory of the
Jetty HTTPS connector. The whole reload runs under the factory's lock. If loading
fails, the factory gets its previous context back, so new connections never see a
factory without keys.

Hot reload runs for every factory without settings. A certificate is due before it
expires by a third of its lifetime, but by no more than 7 days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed reload now makes the Jetty factory load its previous key and trust stores from
memory. Giving it back the previous SSLContext skipped Jetty's SNI tables, so with
sniRequired every handshake failed.

The reload holds the factory's lock through unload(...), so a custom reload(...) runs
once per successful reload. The hot reload date is read from the keys that new
connections use, so it follows replacements that the factory installed by itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The adapter no longer caches the hot reload date or handles a factory that a reload
outside Ignite left without keys: the date is read from the factory, and such a factory
is reported as a failure. The stores to restore are plain local variables.

The tests drop the node-level check of a failed hot reload, which runs the same code as
a failed manual reload, and merge the two hot reload date tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each registered factory gets its reload operations when it is registered: an Ignite
factory through a small adapter, the Jetty factory as is. The hourly check and the reload
command use these entries, so the registry no longer checks factory types in several
places, and the command no longer passes factories back for a lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the HTTPS test

ReloadableSslFactory now serves every registered factory, so its javadoc no longer
limits it to non-Ignite factories, and the date it returns is the one of the keys that
new connections use. A factory registered by a second transport keeps its reload
operations. The metrics page no longer mentions hot reload configuration. The HTTPS test
explains why it sets IGNITE_JETTY_PORT and builds its only standalone factory inline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant