Skip to content

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

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

anton-vinogradov wants to merge 54 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 automatic reload now cover this endpoint. Automatic reload is enabled by default, and each SSL factory keeps its own automatic reload settings.

Behavior

  • When the Jetty connector serves HTTPS, the node registers its TLS factory as HTTP REST. It finds the factory among all components of the connector, so a DetectorConnectionFactory that accepts HTTP and HTTPS on one port is covered too. A successful manual or automatic reload calls Jetty's reload(...) once. 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 set there directly. Once the factory has started, Jetty's getters return the loaded state, so Ignite cannot read a context or store that code sets on the running factory, and a failed reload drops it. The REST API docs ask users to keep the stores in the sources that the factory loads.
  • The certificates expiry comes from the key store that new connections use, so it follows replacements that the factory installed by itself, such as by KeyStoreScanner.
  • Ignite SSL context factories and the Jetty adapter implement one internal interface, ReloadableSslFactory, with init(), autoReloadTime() and isAutoReloadEnabled(). It extends Factory<SSLContext>, so transports still register a Factory<SSLContext>. The registry reloads registered factories that implement the interface, and the reload command reports the others as unsupported, as before.
  • The command reports HTTP REST: reloaded, or the node and the cause. Automatic 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, its certificates count as expired, so automatic reload is due right away, and a reload has nothing to restore: it loads the configured sources. Once the stores are corrected, the reload command brings HTTPS back at once, and automatic reload on its next check.

Automatic reload enabled by default

  • Automatic reload is enabled by default: a failed load keeps the previous context. setAutoReloadEnabled(false) on an SSL factory turns it off for every transport that uses this factory, so an operator can keep the other factories on automatic reload if one factory's source causes problems. The reload command still reloads the factory.
  • Automatic reload becomes due getAutoReloadBeforeExpiryMs() of the factory, 7 days by default, before the earliest certificate expiry in the private key chains. An operator can shorten it for short-lived certificates. The setter rejects zero and negative values.
  • The HTTP REST endpoint takes both settings from its own Jetty factory, so turning automatic reload off for HTTPS leaves binary REST and other transports on it. A Jetty factory keeps the defaults unless it implements the new public interface org.apache.ignite.ssl.jetty.AutoReloadJettySslFactory. To change them, an operator configures the HTTPS connector with a subclass of SslContextFactory.Server that implements the interface and has setters for both properties, and sets them in jetty.xml. Existing jetty.xml files work unchanged.
  • Ignite schedules each factory's next check for its automatic reload time or an hour later, whichever comes first. A slow source can delay other checks on the shared thread. After a failed check, Ignite schedules a retry in one hour. A manual reload also reschedules the check. If Ignite cannot read the expiry after installing the keys, the command continues and Ignite schedules another check in one hour. The check reads the automatic reload date once and decides from it both whether to reload now and when to check next. The first check runs at start in the automatic reload thread, so a factory that fails to report its date does not stop the node start. The node logs the automatic reload date when a check or a reload finds a new one, including one that the factory installed by itself.
  • Once its current certificates are due, the node can load a replacement key store on its next check. The documentation presents the trust-first order as the general rule for replacing certificates.

API changes

The automatic reload settings, metrics and logs use the term "auto reload" instead of "hot reload". "Hot reload" also fits the reload command, which reloads without a restart too, while these settings and metrics cover only the automatic reload. None of the renamed names has been released. Changed in AbstractSslContextFactory:

Before After
isHotReloadEnabled(), setHotReloadEnabled(boolean) isAutoReloadEnabled(), setAutoReloadEnabled(boolean)
getHotReloadBeforeExpiryMs(), setHotReloadBeforeExpiryMs(long) getAutoReloadBeforeExpiryMs(), setAutoReloadBeforeExpiryMs(long)
DFLT_HOT_RELOAD_BEFORE_EXPIRY_MS DFLT_AUTO_RELOAD_BEFORE_EXPIRY_MS
getHotReloadTime() autoReloadTime(), without a prefix, as Spring XML has no setter for it

Spring XML properties are now autoReloadEnabled and autoReloadBeforeExpiryMs. autoReloadEnabled is true by default; to keep reload manual for a factory, set it to false.

Metrics of the ssl registry: ConsecutiveHotReloadFailures is now ConsecutiveAutoReloadFailures, and AutomaticHotReloadAttempts is now AutoReloadAttempts. ManualReloadAttempts stays. The reload thread is now named ssl-auto-reload.

Added to ignite-rest-http, for custom Jetty factories of the HTTPS connector:

package org.apache.ignite.ssl.jetty;

public interface AutoReloadJettySslFactory {
    public boolean isAutoReloadEnabled();
    public long getAutoReloadBeforeExpiryMs();
}

AbstractSslContextFactory now implements the internal ReloadableSslFactory. Its init(), isAutoReloadEnabled() and autoReloadTime() implement the interface.

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 automatic reload installed, and keeps it after a failed manual reload;
  • the certificates expiry 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;
  • with binary REST and HTTPS on one node, both due for automatic reload, a Jetty factory that disables automatic reload in jetty.xml keeps serving certificate A while automatic reload gives binary REST its replacement. The reload command then gives HTTPS its replacement. The HTTPS source fails any load after the one at start and the one by the command;
  • the lead time that a Jetty factory reports sets its automatic reload date;
  • a factory that a failed reload outside Ignite left without keys counts as expired and gets its keys back from the next Ignite reload once the source is fixed;
  • a successful reload calls the factory's reload(...) once.

The core tests check the per-factory schedule and both factory settings. A factory with automatic reload disabled gets no automatic checks, even after a manual reload, and its manual reload does not delay the checks of other factories. The lead time of the factory sets its automatic reload date. A manual reload succeeds even if the factory cannot report its automatic reload time, and the next check comes an hour later.

🤖 Generated with Claude Code

anton-vinogradov and others added 24 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>
…Factory

The interface moves to ignite-commons, next to HotReloadTime, and its methods take the
names that AbstractSslContextFactory already has: init() and getHotReloadTime(). The
factory implements it without new public methods, so the registry needs no adapter. One
register(String, Object) method replaces the two overloads, which would be ambiguous for
a factory that is both a Factory<SSLContext> and a ReloadableSslFactory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly check

With a lead time of a third of the certificate lifetime, a certificate valid for three
hours becomes due an hour before it expires, and the hourly check could come only at
expiry. The hourly check stays. When a factory's certificates become due before the next
hourly check, the registry also checks that factory at that time. A failed attempt is
still retried at the next hourly check, so the failure log keeps an exact next attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The interface now states the hot reload rule and the exception that its implementations
may throw, so init() and getHotReloadTime() of AbstractSslContextFactory and of the Jetty
adapter inherit their javadoc. The class javadoc of AbstractSslContextFactory keeps the
guarantees that only it gives: create() returns the context that init() loaded last, and
the date comes from the key store passed to createKeyManagers(). The Jetty adapter wraps
the exception of a factory left without keys into IgniteException and documents the case
when restoring the previous context fails too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule moves from the separate HotReloadTime class to a static method of the interface
whose getHotReloadTime() describes it, so the contract and its calculation are in one
place. It is a static method rather than a default one, and the 7-day limit is not an
interface field, so AbstractSslContextFactory gets no new public members.

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

reloadIfDue() now only reloads a due factory. check() schedules the next check at the
hot reload time after a check that did not fail, and a manual reload does the same, so
the schedule is set in two places instead of three. The Jetty adapter asserts that it is
created before Jetty starts, when the factory getters return the objects from jetty.xml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hourlyCheck becomes periodicCheck, and the javadoc of the registry and its tests says
"periodic check" instead of "hourly check". A change of CHECK_PERIOD then needs no
renames. The value stays only where it is the point: the constant, the test that pins
it, and the user documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReloadableSslFactory now extends Factory<SSLContext>, so register() takes a
Factory<SSLContext> again instead of an Object, and the registry entry keeps that type.
The Jetty adapter returns the context of the HTTPS connector from create(). It is
serializable only because Factory is, so its Jetty fields are transient.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A periodic check of all factories plus a separate check at the hot reload time needed two
futures per schedule and a comparison of their delays. Now each factory has one scheduled
check: at its hot reload time, but no later than CHECK_PERIOD after the previous one, and
CHECK_PERIOD after a failure. A manual reload reschedules the check of its factory. The
check is scheduled only after the registry has started, which scheduleCheck() itself
verifies, so reload() calls it without a condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The class javadoc now says which lock the reload holds: the internal lock of Jetty's
factory, under which it loads its TLS state and new connections take it. reloadLocked
becomes reloadOrRestore and works on the factory field, ReloadDone becomes SkipUnload,
and TlsMaterial becomes TlsState. The fields are no longer transient: the adapter is
serializable only because Factory is, and serializing it now fails instead of producing
an adapter without its Jetty factory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SkipUnload only keeps the outer unload(...) from unloading the factory. The state that a
failed reload inside has already cleared comes back from restore(...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
onKernalStart() no longer goes over the factories twice with a flag in between: it
creates the hot reload thread for the first factory that supports reload, logs the hot
reload time of each such factory and schedules its first check. The javadoc of reload()
now says that it schedules the next check of its factory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If a reload outside Ignite has left the Jetty factory without TLS state, its getters
throw IllegalStateException. init() let it escape, while ReloadableSslFactory declares
IgniteException; now it wraps it, as getHotReloadTime() already does. The docs no longer
call the next check after a manual reload hourly.

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

After a failed reload, the Jetty factory gets back the context and stores from jetty.xml.
Jetty's getters return the loaded state once the factory has started, so the adapter
cannot keep a context or store that code sets on the running factory. The REST API docs
now ask users to keep the stores in the sources that the factory loads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…load time

A check read the hot reload time twice: once to decide whether to reload, and once
for the delay of the next check. If the time came between the two reads, the check
neither reloaded the factory nor scheduled a check at that time, and waited an hour.
Now one read gives both the decision and the delay.

The registry no longer reads the hot reload time at start. A Jetty factory that a
reload outside Ignite has left without keys fails that read, and the failure stopped
the node start. The first scheduled check now reads and logs the time, and a failure
there is counted and retried like any failed check. The registry logs the time when
it differs from the one logged last.

The REST API docs tell the operator to restart the node when Jetty fails to load the
previous keys back after a failed reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The adapter restored the previous TLS state only after an exception. A reload that
threw an error left the Jetty factory without keys, while ReloadableSslFactory.init()
promises that new connections keep the previous ones after any failed load. The
adapter now restores the state after any throwable, as Ignite factories keep their
context.

The REST API docs no longer describe a failed restore. Jetty restores the previous
context without reading the stores, so a restore fails only when code changes the
running factory's settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test accepts either a reload in the check or a next check within the hot reload
time, so its name now says that the check does not defer the hot reload.

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

A Jetty connector that accepts HTTP and HTTPS on one port keeps its SslConnectionFactory
inside a DetectorConnectionFactory. The node looked only at the top-level connection
factories, so neither the reload command nor hot reload covered such a connector. It now
looks among all components of the connector.

Tests:
- the reload command applies a replaced key store behind a DetectorConnectionFactory;
- the automatic attempt in the HTTP REST registry test succeeds on its own, so the manual
  reload no longer hides its failure;
- the boundary test is deterministic: a later read finds the hot reload time passed;
- the chain test has an issuer that is due before a key certificate that expires sooner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anton-vinogradov

Copy link
Copy Markdown
Contributor Author

/runall

@ignite-pr-checker

ignite-pr-checker commented Nov 24, 2026 •

Copy link
Copy Markdown

@anton-vinogradov 🚀 RunAll queued — build 9523309 · live progress & verdict: Ignite PR Checker. When the run finishes, a new comment brings you the verdict, and this story goes.
🛑 Run cancelled.

anton-vinogradov and others added 4 commits November 24, 2026 22:13
…ontextFactory

ReloadableSslFactory already extends Factory<SSLContext>, so the base class still
implements it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter shape

reloadIfDue() keeps its name, place and early return, and now returns the delay of the
next check. The failure handling in check() is the one from master: a check that fails
during stop schedules nothing, as the stopped executor rejects it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
factories() lists the factories with their transports again, and reload(...) on the
registry takes the factory, now typed as ReloadableSslFactory. RegisteredFactory stays
private. The reload command differs from master only in that type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ates due

The recovery section already says that Ignite keeps the current certificates after a
failed load, which covers the HTTP REST endpoint too.

testLoadWithoutKeyStoreClearsHotReloadDate starts from due certificates, as its
description says. Under the lead of a third of the lifetime, a certificate valid from
an hour ago for 10 more hours was no longer due, so the certificate now starts 30 hours ago.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anton-vinogradov and others added 4 commits November 25, 2026 15:20
…canner reload

A Jetty factory that a failed reload outside Ignite left without state is now due for
hot reload right away, instead of failing to report its date. The scheduled check then
reloads it as the reload command does, so HTTPS comes back within an hour once the
stores are corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…overy wait

The getHotReloadTime() contract says that a factory that has lost the keys of new
connections gives a time that has already come. The registry test no longer uses that
case as an example of a failed read. The HTTPS page asks to wait for the next hot
reload check instead of naming an hour, as one thread serves all checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only the product reads the hot reload time, so getHotReloadTime() becomes
hotReloadTime(), as internal methods have no get prefix. The properties that Spring XML
sets keep their getter and setter pairs: isHotReloadEnabled()/setHotReloadEnabled() and
getHotReloadBeforeExpiryMs()/setHotReloadBeforeExpiryMs(), and the product reads them
through the same getters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hot reload is a node setting now: IgniteConfiguration.setSslHotReloadEnabled(boolean),
enabled by default, and setSslHotReloadBeforeExpiry(long), 7 days by default. They
apply to every transport, HTTP REST included, so the Jetty factory no longer takes them
from the REST connector's SSL factory, and the REST factory rule is back in
GridTcpRestProtocol as on master.

Factories report only the certificates expiry through ReloadableSslFactory, and the
registry subtracts the lead time. AbstractSslContextFactory loses its unreleased hot
reload properties. Ignite.NET does not expose the new properties yet: the parity test
lists them as missing, and the docs point .NET users to Spring XML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anton-vinogradov and others added 13 commits November 25, 2026 16:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReloadableSslFactory gets hotReloadAllowed(), true by default. A custom Ignite factory
whose source allows loads only on request overrides it to return false. The registry
then gives the factory no hot reload check, at start or after a manual reload, while the
reload command still reloads it. The node switch still turns hot reload off for all
factories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scheduler and the manual command both call init(). Remove the per-factory hotReloadAllowed() check and its dedicated test.
Each SSL factory again has its own hot reload switch and lead time, so an
operator can turn hot reload off for one factory whose source causes
problems and keep it for the other transports. Hot reload stays enabled by
default. The HTTP REST endpoint takes both settings from the SSL factory of
the REST connector, or from the node's factory if the connector sets none.

A manual reload still succeeds if the factory cannot report the hot reload
time of the loaded certificates: the registry logs the error and checks the
factory again in an hour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both reloadable factories decide for themselves whether hot reload is
enabled, so the interface no longer gives a default. The registry test
for a failed expiry read after a manual reload now uses the HTTP REST
factory, the only one that can fail that read. The warning names the
next check as nextAttempt, like the warning of a failed check. The TLS
guide says that disabling hot reload on a factory stops it for every
transport that uses this factory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The HTTP REST endpoint took its hot reload switch and lead time from the
SSL factory of binary REST, or from the node's factory. So an operator
could not turn hot reload off for one problematic HTTPS source and keep
it for binary REST, or for discovery and communication.

The Jetty factory of the HTTPS connector now reports its own settings
through the new public interface org.apache.ignite.ssl.ReloadableJettySslFactory
in ignite-rest-http. A custom subclass of SslContextFactory.Server
implements it and has setters, so jetty.xml can set both properties on
the factory. Other Jetty factories keep hot reload enabled with the 7-day
lead time, and existing jetty.xml files work unchanged. The internal
adapter is renamed to JettySslFactoryAdapter, and the REST protocol
classes no longer share the connector factory lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReloadableJettySslFactory sat in org.apache.ignite.ssl, a package that
ignite-core already ships. With both jars on the module path, Java fails
with ResolutionException before Ignite starts, and an OSGi loader takes
the package from ignite-commons and cannot find the interface. The
interface now lives in org.apache.ignite.ssl.jetty, which the Security
group of the Javadoc includes.

The two-transport test lets the HTTPS source load only at start and on
the reload command, so a later automatic load of HTTPS makes the command
fail instead of passing unnoticed. The example factory in the REST docs
rejects a lead time that is not positive, as the Ignite factory does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 5 seconds until binary REST becomes due start when the test creates
the certificate, before the node starts. On a slow start both are due at
once, and binary REST may reload first. The test description now says
that the order holds only on a usual start; the guard against a third
load of the HTTPS source covers the rest.

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

The adapter kept a hotReloadSettings field from the design where it held
the SSL factory of the REST connector. It now held the same Jetty factory
as the factory field, cast to ReloadableJettySslFactory. The adapter now
checks the factory itself, and the field is gone. Variables that hold
adapters are named adapter and adapters instead of factory and
sslFactories, which read like the Jetty factories they wrap. The class
description says that it is an adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Hot reload" also fits the reload command, which reloads without a
restart too, so hotReloadEnabled=false read as if it turned off every
reload. Only the scheduled reload depends on these settings, so the
settings, metrics, logs, reload thread and docs now call it auto reload:

- AbstractSslContextFactory: isAutoReloadEnabled/setAutoReloadEnabled,
  getAutoReloadBeforeExpiryMs/setAutoReloadBeforeExpiryMs,
  DFLT_AUTO_RELOAD_BEFORE_EXPIRY_MS and autoReloadTime();
- the public Jetty interface is AutoReloadJettySslFactory;
- ssl metrics ConsecutiveAutoReloadFailures and AutoReloadAttempts;
- the reload thread ssl-auto-reload.

The manual reload keeps its names. None of the renamed names has been
released.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The negated pattern match read as if the adapter checked whether the
factory could be reloaded at all. Both settings methods now say what
they do: a Jetty factory that implements AutoReloadJettySslFactory gives
its own value, and any other factory gets the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ignite-pr-checker

Copy link
Copy Markdown

@anton-vinogradov ✅ No blockers · full verdict

RunAll 9527049 · 3424e40 · glossary

♻️ Settled after 1 auto re-run wave: #1 — 4 suites that failed mid-run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documentation gives an outdated compatibility rule and omits the newly supported HTTP REST adapter, which could mislead operators about valid endpoints.

1 open issue
What changed in this PR

This pull request adds manual and automatic TLS certificate reload support for Jetty-served HTTP REST HTTPS endpoints, while standardizing SSL automatic-reload APIs, metrics, scheduling, recovery behavior, and documentation.

Changes:

  • Registers Jetty HTTPS factories, including nested detector factories, with Ignite's SSL reload infrastructure.
  • Adds Jetty-specific reload adaptation, per-factory automatic reload settings, scheduling, failure recovery, and updated APIs and metrics.
  • Updates Jetty dependencies, REST and core SSL tests, and related TLS, control-script, REST API, and monitoring documentation.
File Description
parent/​pom.xml Updates the Jetty dependency and Javadoc package grouping.
modules/​rest-http/​src/​test/​resources/​META-INF/​jetty/​https.xml Adds standard Jetty HTTPS test configuration.
modules/​rest-http/​src/​test/​resources/​META-INF/​jetty/​https-source.xml Adds custom-source Jetty HTTPS test configuration.
modules/​rest-http/​src/​test/​resources/​META-INF/​jetty/​https-source-manual.xml Adds Jetty HTTPS configuration with automatic reload disabled.
modules/​rest-http/​src/​test/​resources/​META-INF/​jetty/​https-detector.xml Adds detector-based HTTP and HTTPS connector test configuration.
modules/​rest-http/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​rest/​protocols/​http/​jetty/​JettyRestHttpsReloadTest.java Tests Jetty HTTPS manual, automatic, failed, recovered, detector, SNI, and custom-factory reload behavior.
modules/​rest-http/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​rest/​protocols/​http/​jetty/​GridRestSuite.java Adds the Jetty HTTPS reload tests to the REST test suite.
modules/​rest-http/​src/​main/​java/​org/​apache/​ignite/​ssl/​jetty/​package-info.java Documents the Jetty SSL configuration package.
modules/​rest-http/​src/​main/​java/​org/​apache/​ignite/​ssl/​jetty/​AutoReloadJettySslFactory.java Defines the public contract for Jetty automatic-reload settings.
modules/​rest-http/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​rest/​protocols/​http/​jetty/​JettySslFactoryAdapter.java Adapts Jetty SSL factories to Ignite reload, expiry, and failure-recovery handling.
modules/​rest-http/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​rest/​protocols/​http/​jetty/​GridJettyRestProtocol.java Registers Jetty HTTPS SSL factories with the shared SSL reload registry.
modules/​rest-http/​pom.xml Adds the test-only Bouncy Castle dependency.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​ssl/​SslContextFactoryHotReloadTest.java Renames and updates SSL context factory automatic-reload tests.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​ssl/​SslCertificateHotReloadTest.java Updates node-level certificate automatic-reload and metrics tests.
modules/​core/​src/​test/​java/​org/​apache/​ignite/​internal/​processors/​ssl/​SslFactoryRegistryTest.java Tests per-factory scheduling, retry behavior, settings, metrics, and reload handling.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​ssl/​SslFactoryRegistry.java Implements per-factory automatic reload scheduling, retries, metrics, and reload handling.
modules/​core/​src/​main/​java/​org/​apache/​ignite/​internal/​management/​ssl/​SslReloadTask.java Supports manual reloads for all implementations of the reloadable SSL factory contract.
modules/​commons/​src/​main/​java/​org/​apache/​ignite/​ssl/​AbstractSslContextFactory.java Renames automatic-reload settings and enables them by default.
modules/​commons/​src/​main/​java/​org/​apache/​ignite/​internal/​processors/​ssl/​ReloadableSslFactory.java Introduces the common internal reloadable SSL factory contract and expiry utilities.
docs/​_docs/​tools/​control-script.adoc Documents TLS certificate reload behavior for HTTP REST and other supported transports.
docs/​_docs/​security/​ssl-tls.adoc Updates automatic-reload configuration, scheduling, recovery, and renamed API guidance.
docs/​_docs/​restapi.adoc Documents Jetty HTTPS configuration, certificate reload behavior, and automatic-reload settings.
docs/​_docs/​monitoring-metrics/​new-metrics.adoc Documents the renamed SSL automatic-reload metrics.

Review effort: Lite

Comment thread docs/_docs/tools/control-script.adoc Resolved
…and docs

The reload command docs listed the transports whose factories must
extend AbstractSslContextFactory, but did not say what the check means
for the HTTP REST endpoint. It passes with any Jetty factory, standard
or custom.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

/** */
private volatile long hotReloadBeforeExpiryMs = DFLT_HOT_RELOAD_BEFORE_EXPIRY_MS;
private volatile long autoReloadBeforeExpiryMs = DFLT_AUTO_RELOAD_BEFORE_EXPIRY_MS;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need a millis accuracy here ? Or it common approach for timing setting ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Ignite keeps timing settings in milliseconds, for example failureDetectionTimeout, checkpointFrequency and ClientConnectorConfiguration.idleTimeout. Millisecond precision is not needed here, but short-lived certificates need a lead time of hours, and the Ms suffix keeps the unit visible in Spring XML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
if (sslFactory != null) {
registered.logHotReloadTime(sslFactory.getHotReloadTime());
if (executor == null)
executor = newSingleThreadScheduledExecutor("ssl-auto-reload", ctx.igniteInstanceName());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It not relates to the patch, just thinking - why we need a separate pool here and not use :
GridTimeoutObject
GridTimeoutProcessor#addTimeoutObject

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLS reload can block on the certificate source, for example a remote store, an HSM or a custom loadKeyStore. GridTimeoutProcessor calls onTimeout() inline in its single grid-timeout-worker, so a slow load would delay all other timeouts of the node and be reported as a blocked system-critical thread. A separate thread keeps the delay inside TLS reload, and node stop can interrupt a hung load.

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.

5 participants