anton-vinogradov opened a new pull request, #13874:
URL: https://github.com/apache/ignite/pull/13874

   [IGNITE-29212](https://issues.apache.org/jira/browse/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 ask this 
factory to reload. The factory keeps its `jetty.xml` settings and reads its own 
source, so standard and custom Jetty factories work the same way.
   - Jetty 12.1.14 clears the TLS state of its factory before it loads the 
replacement. New connections take that state under the factory's lock. The node 
runs the whole reload inside an outer `SslContextFactory.reload(...)` call, and 
if loading fails, it gives the factory its previous `SSLContext` back before 
the lock is released. New connections wait for the reload and then get either 
the replacement or the previous keys, as with Ignite factories. Established 
connections stay open.
   - 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 next command or hot 
reload loads it again.
   
   ## 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](https://issues.apache.org/jira/browse/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:
   
   ```java
   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 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;
   - a failed hot reload is counted and keeps the previous certificate;
   - the hot reload date follows the loaded keys and stays after a failed load;
   - a reload restores a factory that a failed reload outside Ignite left 
without keys.
   
   The core tests check the new lead time rule and the registry without the hot 
reload switch.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to