anton-vinogradov opened a new pull request, #13847: URL: https://github.com/apache/ignite/pull/13847
[IGNITE-29310](https://issues.apache.org/jira/browse/IGNITE-29310) lets a custom SSL context factory use automatic TLS certificate hot reload from IGNITE-29211. Such a factory extends `AbstractSslContextFactory` and gets a key store and the password of its keys from its own source. It keeps its own key and trust algorithms and its trust managers. ## Behavior - A factory creates its key managers with the new `createKeyManagers(KeyManagerFactory, KeyStore, char[])`. The method initializes the key manager factory with the key store and password and takes the hot reload date from the same key store. One request to the source therefore gives both the keys for TLS and the chains for the date. `SslContextFactory` loads its key store file through the same method. - The date is published only after the whole `SSLContext` is created. If the key cannot be opened or the trust material cannot be loaded, the previous context and date remain. - The registry schedules every factory that extends `AbstractSslContextFactory` and has hot reload enabled. It uses the existing hourly check, retries, metrics and shutdown. Hot reload stays disabled by default, so existing custom factories still load only at startup and on `control.sh --ssl reload`. - A factory that does not call the new method has no hot reload date. With hot reload enabled, the node logs `TLS hot reload has no scheduled date [transports=…]` and keeps the schedule. A later manual reload can bring the first date. This warning replaces the former warning about a missing private key and covers both cases. - A factory can override `isHotReloadEnabled()`, for example to keep a source that supports only manual updates out of the hourly check. ## API changes in `AbstractSslContextFactory` Moved from `SslContextFactory`, which inherits them: ```java public static final long DFLT_HOT_RELOAD_BEFORE_EXPIRY_MS public boolean isHotReloadEnabled() public void setHotReloadEnabled(boolean enabled) public final long getHotReloadBeforeExpiryMs() public void setHotReloadBeforeExpiryMs(long millis) public final long getHotReloadTime() ``` Added: ```java protected final KeyManager[] createKeyManagers(KeyManagerFactory keyMgrFactory, KeyStore store, char[] pwd) throws GeneralSecurityException ``` Compared with IGNITE-29211, `getHotReloadBeforeExpiryMs()` and `getHotReloadTime()` became `final`: Ignite calculates the date from the published expiry and the checked lead time. None of these members has been released yet. The existing `createKeyManagers()` and `createTrustManagers()` extension points keep their signatures. ## Compatibility The Java writer of the .NET configuration still recognizes only `SslContextFactory` and its subclasses. For a factory that extends only `AbstractSslContextFactory`, it writes that there is no factory, as before. ## Tests - A factory that extends only `AbstractSslContextFactory` reloads a key store that has a different password. A new TLS connection presents the new certificate, and the date comes from it. A wrong password keeps the previous certificate and date. - The hourly check reloads such a factory after its key store file is replaced. - The existing warning test expects the new message. - The other scheduling, metrics, shutdown and reload command tests from IGNITE-29211 pass unchanged. 🤖 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]
