Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
59d67ed
IGNITE-29212 Reload HTTP REST certificates from the Jetty configuration
anton-vinogradov Nov 23, 2026
53781dc
IGNITE-29212 Keep SNI selection after a failed HTTPS reload
anton-vinogradov Nov 23, 2026
0e366a1
IGNITE-29212 Simplify the Jetty factory adapter and its tests
anton-vinogradov Nov 23, 2026
0d0d871
IGNITE-29212 Keep reload operations on the registry's entries
anton-vinogradov Nov 23, 2026
f609943
IGNITE-29212 Describe ReloadableSslFactory for all factories and tidy…
anton-vinogradov Nov 23, 2026
f12dafe
IGNITE-29212 Restore the working Jetty TLS context after a failed reload
anton-vinogradov Nov 24, 2026
091d200
IGNITE-29212 Let Ignite SSL context factories implement ReloadableSsl…
anton-vinogradov Nov 24, 2026
9bc3e67
IGNITE-29212 Check a factory when it becomes due before the next hour…
anton-vinogradov Nov 24, 2026
40111c6
IGNITE-29212 Document overrides of ReloadableSslFactory with inheritDoc
anton-vinogradov Nov 24, 2026
10fd2ab
IGNITE-29212 Keep the hot reload date rule in ReloadableSslFactory
anton-vinogradov Nov 24, 2026
29c9def
IGNITE-29212 Separate the hot reload attempt from scheduling the next…
anton-vinogradov Nov 24, 2026
b32d01f
IGNITE-29212 Name the registry's check after its role, not its period
anton-vinogradov Nov 24, 2026
949d8de
IGNITE-29212 Register SSL context factories with their type
anton-vinogradov Nov 24, 2026
58b4ac7
IGNITE-29212 Give each SSL factory one scheduled check
anton-vinogradov Nov 24, 2026
a914e1a
IGNITE-29212 Name the Jetty factory lock in the adapter
anton-vinogradov Nov 24, 2026
47a838a
IGNITE-29212 Say what SkipUnload does not do
anton-vinogradov Nov 24, 2026
e9a9a9b
IGNITE-29212 Start hot reload in one pass over the registered factories
anton-vinogradov Nov 24, 2026
9872636
IGNITE-29212 Report a Jetty factory without TLS state as IgniteException
anton-vinogradov Nov 24, 2026
dc19b58
Merge remote-tracking branch 'origin/master' into ignite-29212-jetty
anton-vinogradov Nov 24, 2026
189017e
IGNITE-29212 Document that a failed HTTPS reload drops stores set on …
anton-vinogradov Nov 24, 2026
74ccdd0
IGNITE-29212 Decide each hot reload check from one read of the hot re…
anton-vinogradov Nov 24, 2026
acc33ad
IGNITE-29212 Keep the HTTPS keys when a Jetty reload throws an error
anton-vinogradov Nov 24, 2026
cae7151
IGNITE-29212 Name the boundary test after the guarantee it checks
anton-vinogradov Nov 24, 2026
bb16792
IGNITE-29212 Find the HTTPS factory inside nested Jetty connection fa…
anton-vinogradov Nov 24, 2026
09f0606
IGNITE-29212 Drop the redundant Factory<SSLContext> from AbstractSslC…
anton-vinogradov Nov 24, 2026
7461a26
IGNITE-29212 Keep the registry's check and reloadIfDue() in their mas…
anton-vinogradov Nov 24, 2026
49048a5
IGNITE-29212 Keep the SSL factory registry API from master
anton-vinogradov Nov 24, 2026
92846f7
IGNITE-29212 Drop a repeated docs sentence and keep a test's certific…
anton-vinogradov Nov 24, 2026
8cd54e0
IGNITE-29212 Keep a switch to disable hot reload of an Ignite SSL fac…
anton-vinogradov Nov 25, 2026
59a786e
IGNITE-29212 Word the hot reload lead by the time left before expiry
anton-vinogradov Nov 25, 2026
b25b363
IGNITE-29212 Keep the fixed hot reload lead time and its setting from…
anton-vinogradov Nov 25, 2026
688367b
IGNITE-29212 Take the HTTPS hot reload settings from the REST connect…
anton-vinogradov Nov 25, 2026
7b24c63
IGNITE-29212 Clarify the hot reload time contract and the Jetty lead …
anton-vinogradov Nov 25, 2026
216ff93
IGNITE-29212 Let the reload command bring back HTTPS after a failed K…
anton-vinogradov Nov 25, 2026
7a46ad3
IGNITE-29212 Let hot reload bring back HTTPS after a failed KeyStoreS…
anton-vinogradov Nov 25, 2026
19c24f8
IGNITE-29212 State the due time of a factory without keys and the rec…
anton-vinogradov Nov 25, 2026
bd23634
IGNITE-29212 Name the internal hot reload time getter without a prefix
anton-vinogradov Nov 25, 2026
6713f83
IGNITE-29212 Move the hot reload settings to IgniteConfiguration
anton-vinogradov Nov 25, 2026
9855067
IGNITE-29212 State the unit of the hot reload lead time in the docs
anton-vinogradov Nov 25, 2026
a5f1626
IGNITE-29212 Let a factory keep its source on manual reload only
anton-vinogradov Nov 25, 2026
ea8a0d6
IGNITE-29212 Clarify which TLS factories Ignite schedules
anton-vinogradov Nov 25, 2026
0139eef
IGNITE-29212 Use the node setting for automatic TLS reload
anton-vinogradov Nov 25, 2026
8dfaf3e
IGNITE-29212 Retry reading certificate expiry after a manual TLS reload
anton-vinogradov Nov 25, 2026
bfe231e
IGNITE-29212 Return the hot reload settings to the SSL factory
anton-vinogradov Nov 26, 2026
815381e
IGNITE-29212 Tidy up the factory hot reload switch after self-review
anton-vinogradov Nov 26, 2026
e31545b
IGNITE-29212 Take the HTTPS hot reload settings from the Jetty factory
anton-vinogradov Nov 26, 2026
3808c23
IGNITE-29212 Move the Jetty hot reload settings to their own package
anton-vinogradov Nov 26, 2026
c61f672
IGNITE-29212 Do not promise the check order in the two-transport test
anton-vinogradov Nov 26, 2026
13bf79b
IGNITE-29212 Name the Jetty adapter and its variables after what they…
anton-vinogradov Nov 26, 2026
76e2ce4
IGNITE-29212 Call the scheduled certificate reload auto reload
anton-vinogradov Nov 26, 2026
3424e40
IGNITE-29212 Spell out the Jetty settings check in the adapter
anton-vinogradov Nov 26, 2026
b058357
IGNITE-29212 Say which factory check applies to HTTP REST in the comm…
anton-vinogradov Nov 27, 2026
7af11c4
IGNITE-29212 Name the X.509 certificate variable in the chain expiry
anton-vinogradov Nov 27, 2026
660c7cc
IGNITE-29212 Clarify manual and automatic certificate hot reload in t…
anton-vinogradov Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/_docs/monitoring-metrics/new-metrics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,12 @@ Register name: `ssl`
[cols="2,1,3",opts="header"]
|===
|Name | Type | Description
|ConsecutiveHotReloadFailures | long | Number of consecutive automatic hot reload failures.
|ConsecutiveAutoReloadFailures | long | Number of consecutive automatic reload failures.
|ManualReloadAttempts | long | Number of manual reload attempts.
|AutomaticHotReloadAttempts | long | Number of automatic hot reload attempts.
|AutoReloadAttempts | long | Number of automatic reload attempts.
|===

See link:security/ssl-tls#automatic-certificate-hot-reload[Automatic Certificate Hot Reload] for configuration and recovery.
See link:security/ssl-tls#automatic-certificate-reload[Automatic Certificate Reload] for configuration and recovery.

== Communication Connection Pool

Expand Down
67 changes: 67 additions & 0 deletions docs/_docs/restapi.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,73 @@ NOTE: Ignite uses Jetty 12. Custom Jetty XML configurations created for earlier
include::code-snippets/xml/jetty.xml[tags=, indent=0]
----

=== HTTPS

Configure the HTTPS connector, its SSL context factory, and its key and trust stores in the Jetty XML file set by `setJettyPath(String)`.
Both the standard Jetty factory and custom subclasses of `SslContextFactory.Server` work.

After you replace the stores, run the link:tools/control-script#reloading-tls-certificates[`--ssl reload` command].
The node also reloads the stores automatically before its certificates expire, as described in link:security/ssl-tls#automatic-certificate-reload[Automatic Certificate Reload].
By default, automatic reload of the Jetty factory is enabled and becomes due 7 days before the earliest certificate expiry in its private key chains.
To change these settings for a factory, configure it with your own subclass of `SslContextFactory.Server` that implements `org.apache.ignite.ssl.jetty.AutoReloadJettySslFactory` from the `ignite-rest-http` module.
The interface has getters for two properties: `autoReloadEnabled` and `autoReloadBeforeExpiryMs`, the lead time in milliseconds, which must be positive.
Add setters for them, so that the Jetty XML file can set them:

[source,java]
----
public class MySslContextFactory extends SslContextFactory.Server implements AutoReloadJettySslFactory {
private boolean autoReloadEnabled = true;

private long autoReloadBeforeExpiryMs = AbstractSslContextFactory.DFLT_AUTO_RELOAD_BEFORE_EXPIRY_MS;

@Override public boolean isAutoReloadEnabled() {
return autoReloadEnabled;
}

public void setAutoReloadEnabled(boolean autoReloadEnabled) {
this.autoReloadEnabled = autoReloadEnabled;
}

@Override public long getAutoReloadBeforeExpiryMs() {
return autoReloadBeforeExpiryMs;
}

public void setAutoReloadBeforeExpiryMs(long autoReloadBeforeExpiryMs) {
if (autoReloadBeforeExpiryMs <= 0)
throw new IllegalArgumentException("autoReloadBeforeExpiryMs must be positive: " + autoReloadBeforeExpiryMs);

this.autoReloadBeforeExpiryMs = autoReloadBeforeExpiryMs;
}
}
----

Then set the properties on the factory in the Jetty XML file:

[source,xml]
----
<Arg name="sslContextFactory">
<New class="com.example.MySslContextFactory">
<Set name="keyStorePath">/opt/ignite/config/https.jks</Set>
<Set name="keyStorePassword">changeit</Set>
<Set name="autoReloadEnabled">false</Set>
</New>
</Arg>
----

These settings apply only to this factory: other transports keep their own automatic reload settings.
Changing them requires a node restart.
The reload command reloads the factory either way.

Each reload asks the Jetty factory to load its stores again.
New connections use the replacement certificates; established connections stay open.
If loading fails, the endpoint keeps its current keys and trust settings, and new connections keep working with them.
Correct the stores and run the command again.
A failed reload by Jetty's own `KeyStoreScanner` leaves the endpoint without keys.
Correct the stores, then run the command or, if automatic reload is enabled, wait for its next check, as described in link:security/ssl-tls#when-automatic-reload-runs[When Automatic Reload Runs].

Keep the stores in the sources that the factory loads: the store paths in the Jetty XML file, or the `loadKeyStore(Resource)` and `loadTrustStore(Resource)` methods of a custom subclass.
A store that your code sets on the running factory, for example with `setKeyStore(KeyStore)`, does not survive a failed reload: the next reload loads the stores configured in the Jetty XML file instead.

=== Security

When link:security/authentication[authentication] is configured in the cluster, all applications that use REST API request authentication by providing security credentials.
Expand Down
100 changes: 61 additions & 39 deletions docs/_docs/security/ssl-tls.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,15 @@ include::{javaFile}[tag=disable-validation,indent=0]

== Upgrading Certificates

You can replace certificate files and reload them without restarting nodes that use `SslContextFactory`.
Certificate hot reload lets nodes that use `SslContextFactory` load replacement certificates without restarting.
You can request a reload immediately or let Ignite reload certificates automatically before they expire.
The link:tools/control-script#reloading-tls-certificates[`--ssl reload` command] updates TCP transports on all server and thick-client nodes.
It does not reload TLS for the HTTP REST endpoint (Jetty) or external client applications.
It also reloads the link:restapi#https[HTTP REST endpoint] when its Jetty connector uses HTTPS.
External client applications reload their certificates separately.

Follow the trust-first order below even if you do not plan to run the command.
<<Automatic Certificate Reload,Automatic reload>> is enabled by default, so a node can load a replaced key store on its next check once its current certificates are due.
If a peer does not trust the new certificate yet, its new connections to that node fail.

. Back up the key and trust store files before replacing them.
Keep their configured paths, store types, and passwords unchanged; changing node configuration requires a restart.
Expand All @@ -182,60 +188,75 @@ Check the affected node's log for error details.
Correct the failed store and run the command again.
To restore the previous certificates, restore the backed-up files and reload again while peers still trust those certificates.

Custom factories must extend javadoc:org.apache.ignite.ssl.AbstractSslContextFactory[].
Custom factories for discovery, communication, client connector, and binary REST must extend javadoc:org.apache.ignite.ssl.AbstractSslContextFactory[].
They must reread key and trust data from their sources on reload and supply the updated context for new connections.
If any factory on a node has another type, the command reports it as unsupported and reloads nothing on that node.
If any of these transports uses another type of factory, the command reports it as unsupported and reloads nothing on that node.
For these factories, follow the same trust-first sequence and restart affected nodes one at a time instead of running reload.
If you configured `trustManagers` directly, the command reuses them instead of reloading a trust store.

== Automatic Certificate Hot Reload
== Automatic Certificate Reload

Automatic hot reload lets nodes load replacement certificates without a reload command.
Automatic reload lets nodes load replacement certificates without a reload command.
You must supply the replacements: Ignite reads them from the configured source and does not issue certificates.
Hot reload covers the same TCP transports as <<Upgrading Certificates,manual reload>>.
It does not update the HTTP REST endpoint or external client applications.
Automatic reload covers the same transports as <<Upgrading Certificates,manual reload>>, including the HTTP REST endpoint.
It does not update external client applications.

=== Enable Hot Reload
=== Disable Automatic Reload

Enable hot reload on each configured factory before starting the node:
Automatic reload is enabled by default.
To disable it, call `setAutoReloadEnabled(false)` on the factory before starting the node.
Automatic reload stops for every transport that uses this factory, and other factories keep it:

[source,java]
----
factory.setHotReloadEnabled(true);
factory.setAutoReloadEnabled(false);
----

Changing this setting requires a node restart.
The reload command still reloads the factory.
For the HTTP REST endpoint, set this property on its Jetty factory, as described in link:restapi#https[HTTPS].

The `SslContextFactory` of Ignite.NET has no `autoReloadEnabled` or `autoReloadBeforeExpiryMs` property.
To set them for a .NET node, define the SSL factory in the Spring XML file set by `IgniteConfiguration.SpringConfigUrl`.
Leave `IgniteConfiguration.SslContextFactory` unset: it replaces the factory from the XML file.

=== Supply Replacements

The key store must contain a private key with an X.509 certificate chain.
A chain contains the key's certificate and the certificates of its issuers.
Ignite ignores keys without such a chain, as TLS does.
If the key store has no such key, the node logs a warning and skips hot reload.
After a manual reload of a key store with such a key, hot reload works again.
If the key store has no such key, the node logs a warning and skips automatic reload.
After a manual reload of a key store with such a key, automatic reload works again.

Before replacing key stores, prepare peers' trust stores as described in <<Upgrading Certificates>>.
Once every affected peer trusts the replacement certificates, put the replacement key stores in the configured source.
Put only certificates whose validity period has already started.
Ignite installs the replacements without checking their dates, and peers may reject certificates that are not yet valid.
Keep the configured paths, store types and passwords unchanged.
Ignite loads the replacements automatically when hot reload is due; no reload command is needed for this step.
Ignite loads the replacements when automatic reload is due; no reload command is needed for this step.

=== When Hot Reload Runs
=== When Automatic Reload Runs

At startup, Ignite checks each factory with hot reload enabled.
After it finishes checking all factories, it waits one hour before checking them again.
A slow certificate source can therefore delay a factory's next check by more than an hour.
At startup, Ignite schedules a check for each factory with automatic reload enabled.
If a factory's certificates are not yet due, Ignite schedules its next check for the due date or one hour later, whichever comes first.
After a failed attempt, Ignite schedules another check for one hour later.
All checks share one thread, so a slow certificate source can delay checks for other factories.

For each factory, hot reload becomes due `hotReloadBeforeExpiryMs` before the earliest certificate expiry in its private key chains.
For each factory, automatic reload becomes due `autoReloadBeforeExpiryMs` before the earliest certificate expiry in its private key chains.
This includes issuing certificates. The default lead time is 7 days.
For the HTTP REST endpoint, Ignite takes the certificates from the key store that the Jetty factory has loaded, and the lead time from the same factory, as described in link:restapi#https[HTTPS].
The first check at or after that date attempts a reload, including the startup check.
Allow enough time before expiry to supply the replacements, wait through the one-hour interval and load the stores.
Allow enough time before expiry to supply the replacements and load the stores.
Keep the lead time shorter than the lifetime of the replacement certificates, or they will already be due when loaded.
See link:{javadoc_base_url}/org/apache/ignite/ssl/AbstractSslContextFactory.html#getHotReloadTime()[getHotReloadTime(), window=_blank] for the calculation.
See link:{javadoc_base_url}/org/apache/ignite/ssl/AbstractSslContextFactory.html#autoReloadTime()[autoReloadTime(), window=_blank] for the calculation.

If the loaded certificates are still due for hot reload, Ignite records a failed hot reload attempt even though it installed them.
This can happen when the certificates have not changed, only the trust store changed, or the replacements expire within `hotReloadBeforeExpiryMs`.
If the loaded certificates are still due for automatic reload, Ignite records a failed automatic reload attempt even though it installed them.
This can happen when the certificates have not changed, only the trust store changed, or the replacements expire within `autoReloadBeforeExpiryMs`.
The loaded context remains in use until a later reload replaces it.

After a manual reload, the next hourly check uses the loaded certificates.
After a manual reload, Ignite schedules the next check from the loaded certificates.
If Ignite cannot read their expiry dates, the new certificates stay in use and the command continues.
Ignite logs the error and schedules another check for one hour later.

New connections use the loaded certificates; established connections remain open.
To confirm a replacement, open a new TLS connection to each affected endpoint and compare its peer certificate with the replacement.
Expand All @@ -244,22 +265,22 @@ To confirm a replacement, open a new TLS connection to each affected endpoint an

If loading the stores or creating the TLS context fails, Ignite keeps the current certificates and retries on the next check, even after they expire.
Keeping expired certificates does not extend their validity, so new connections may fail until a valid replacement is available.
If the replacements appear after hot reload is due, the next retry loads them.
If the replacements appear after automatic reload is due, the next retry loads them.

The node log shows the affected transports.
At `INFO` level it shows when the loaded certificates are due for hot reload, when an attempt starts and when it succeeds.
At `INFO` level it shows when the loaded certificates are due for automatic reload, when an attempt starts and when it succeeds.
At `WARN` level it shows why an attempt failed and when the node retries automatically.
At `DEBUG` level it also shows the start of each check.
The `ssl.ConsecutiveHotReloadFailures` metric sums consecutive failed automatic attempts across the node's factories.
Each factory's count resets after a successful manual reload or when a check finds that the loaded certificates are no longer due for hot reload.
The `ssl.ConsecutiveAutoReloadFailures` metric sums consecutive failed automatic attempts across the node's factories.
Each factory's count resets after a successful manual reload or when a check finds that the loaded certificates are no longer due for automatic reload.

To recover without waiting for the next retry:

. Correct the replacement stores and run link:tools/control-script#reloading-tls-certificates[`control.sh --ssl reload`].
. Check the command result and verify a new connection with the replacement certificates.

*What happens to automatic hot reload.*
If enabled, automatic hot reload continues after manual reload, as described in <<When Hot Reload Runs>>.
*What happens to automatic reload.*
If enabled, automatic reload continues after manual reload, as described in <<When Automatic Reload Runs>>.
A failed automatic attempt does not undo the manual reload.

*If the command cannot connect.*
Expand All @@ -270,11 +291,12 @@ Otherwise, or to load the corrected stores without waiting, restart the affected

=== Custom Certificate Sources

For automatic hot reload, a custom factory creates its key managers with `createKeyManagers(KeyManagerFactory, KeyStore, char[])` of javadoc:org.apache.ignite.ssl.AbstractSslContextFactory[].
For automatic reload, a custom Ignite factory creates its key managers with `createKeyManagers(KeyManagerFactory, KeyStore, char[])` of javadoc:org.apache.ignite.ssl.AbstractSslContextFactory[].
On each load, call this method once with the key store and the key password that your source returned.
Ignite takes the hot reload date from that key store.
A factory that does not call this method has no hot reload date, and the node logs a warning.
Limit request duration in custom sources: a blocked load delays other hot reloads and manual reload.
Ignite takes the automatic reload date from that key store.
A factory that does not call this method has no automatic reload date, and the node logs a warning.
A custom Jetty factory of the HTTP REST endpoint needs no such call: Ignite takes the date from the key store that the Jetty factory loads, for example in `loadKeyStore(Resource)`.
Limit request duration in custom sources: a blocked load delays other automatic reloads and manual reload.

== SslContextFactory Properties

Expand Down Expand Up @@ -304,12 +326,12 @@ Limit request duration in custom sources: a blocked load delays other hot reload
|The protocol for secure transport. https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#sslcontext-algorithms[Supported algorithms,window=_blank].
|`TLS`

|`hotReloadEnabled`
|Enables automatic certificate hot reload. See <<Automatic Certificate Hot Reload>>.
|`false`
|`autoReloadEnabled`
|Enables automatic certificate reload. See <<Automatic Certificate Reload>>.
|`true`

|`hotReloadBeforeExpiryMs`
|How long before the certificates expire hot reload becomes due, in milliseconds. See <<When Hot Reload Runs>>.
|`autoReloadBeforeExpiryMs`
|How long before the certificates expire automatic reload becomes due, in milliseconds. See <<When Automatic Reload Runs>>.
|`604800000` (7 days)

|`trustStoreFilePath`
Expand Down
6 changes: 3 additions & 3 deletions docs/_docs/tools/control-script.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ Enable it in the configuration (`IgniteConfiguration#setClientConnectorConfigura
== Reloading TLS Certificates

Use `--ssl reload` to load replaced key and trust stores on all server and thick-client nodes in the current topology.
It reloads discovery, communication, client connector, and binary REST transports that started with TLS.
It reloads discovery, communication, client connector, binary REST, and the link:restapi#https[HTTP REST endpoint] when they use TLS.
New connections use the replacement context; established connections stay open.
The command does not reload TLS for the HTTP REST endpoint (Jetty).

Follow link:security/ssl-tls#upgrading-certificates[Upgrading Certificates] to prepare peer trust, replace the files, and verify the result.
Add the <<connecting-to-cluster,connection parameters>> required by your cluster:
Expand All @@ -190,7 +189,8 @@ When security is enabled, logs identify the initiator by login and subject ID.
This is the control-script user, or the node receiving a JMX call.

The report lists every target node, even if none of its TCP transports use TLS.
Each node first checks that all registered factories extend `AbstractSslContextFactory`.
Each node first checks that the factories of discovery, communication, client connector, and binary REST extend `AbstractSslContextFactory`.
The HTTP REST endpoint passes this check with any Jetty factory, standard or custom, as described in link:restapi#https[HTTPS].
If any factory is unsupported, that node reloads none of its factories.
Otherwise, it reloads them until the first failure and reports the error.
Other nodes continue independently.
Expand Down
Loading
Loading