[ 
https://issues.apache.org/jira/browse/IGNITE-29209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Vinogradov updated IGNITE-29209:
--------------------------------------
    Description: 
A custom SSL factory can obtain a certificate and its initialized context from 
one key-store read. This lets a subclass authenticate a restarted node with the 
same certificate its TLS connections will use. The manual reload and automatic 
renewal tasks use the same snapshot.

h3. Result

* The first {{create()}} initializes the context once. Subsequent callers get 
the accepted context while another thread reloads it. A subclass can call 
protected {{init()}} to load and publish fresh material. If loading fails, the 
previous context, engines and sockets remain usable.
* The snapshot contains immutable X.509 chains by private-key alias. An empty 
map means the store has no such chains. A custom source that cannot report its 
chains returns null metadata.
* Serialization keeps the configuration. Restoring a serialized factory reloads 
material on first use.

h3. Compatibility

Update and recompile subclasses that override {{create()}}, implement the old 
{{createKeyManagers()}} hook or use the protected {{sslCtx}} field. A subclass 
can still supply a null key store for a client without its own key. Unknown 
protocol or cipher suite names now fail at first initialization, including node 
startup. See the [subclass migration 
guide|https://github.com/anton-vinogradov/ignite/blob/ignite-29209/docs/_docs/security/ssl-tls.adoc#migrating-an-existing-factory].

[PR #13751 and validation|https://github.com/apache/ignite/pull/13751].

  was:
Keep each SSL context with the certificate chains from the same key-store read. 
This lets a factory subclass that needs a fresh certificate at startup read the 
certificate chain and initialize TLS from the same load. IGNITE-29210 uses the 
same snapshot for reload and status, and IGNITE-29211 uses its expiry dates for 
renewal.

h3. Result and acceptance

* A subclass can call protected {{init()}} to load a fresh bundle, including on 
an embedded node restart with the same factory. After validating that its 
context can create an engine, the factory publishes and returns that bundle. A 
failed attempt keeps the previous material and can be retried.
* {{create()}} initializes once, including concurrent first calls, and returns 
the accepted context. Repeated calls reuse the context. Serialization keeps the 
configuration and drops runtime contexts.
* Obtain the context again after successful {{init()}}. Previously obtained 
contexts, engines, socket factories and sockets retain their material. Reusing 
a factory on restart keeps its material until the subclass reloads it.
* Metadata contains immutable, nonempty X.509 chains of key entries. Unknown 
metadata and an empty chain map are distinct. Metadata describes loaded 
material, not the certificate selected for a connection.

h3. Compatibility

Affected subclasses must be updated and recompiled: {{create()}} becomes final; 
the protected {{sslCtx}} field and {{createKeyManagers()}} hook are removed. 
Implement the protected {{createSslBundle()}} hook, which may throw 
{{SSLException}}. Store-backed implementations load once and use 
{{createSslBundle(store, keyPassword, algorithm)}}. See the [migration 
reference|https://github.com/anton-vinogradov/ignite/blob/ignite-29210/docs/_docs/security/ssl-tls.adoc#migrating-an-existing-factory].

Rename any no-argument {{init()}} method declared by your subclass. Direct 
subclasses of {{AbstractSslContextFactory}} that retain {{checkParameters()}} 
must remove its {{@Override}} and call it from {{createSslBundle()}}; 
subclasses of {{SslContextFactory}} can keep that override.

Plain {{Factory<SSLContext>}} remains supported. Empty stores support clients 
without private keys; loaded stores must remain unchanged while their contexts 
are in use. Unsupported TLS names fail first initialization. Certificate-date 
and empty-chain replacement policies belong to IGNITE-29210.

h3. Delivery and validation

[PR #13751|https://github.com/apache/ignite/pull/13751] contains this change. 
At {{c20c22e5}}, all 13 metadata tests, Checkstyle and Javadoc/doclint passed. 
A local TLS handshake check verified that restarting with the same factory can 
reload a new certificate and keep the last working context after a failure.


> Add SSL bundle metadata and explicit factory initialization
> -----------------------------------------------------------
>
>                 Key: IGNITE-29209
>                 URL: https://issues.apache.org/jira/browse/IGNITE-29209
>             Project: Ignite
>          Issue Type: Sub-task
>            Reporter: Anton Vinogradov
>            Assignee: Anton Vinogradov
>            Priority: Major
>              Labels: ise
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> A custom SSL factory can obtain a certificate and its initialized context 
> from one key-store read. This lets a subclass authenticate a restarted node 
> with the same certificate its TLS connections will use. The manual reload and 
> automatic renewal tasks use the same snapshot.
> h3. Result
> * The first {{create()}} initializes the context once. Subsequent callers get 
> the accepted context while another thread reloads it. A subclass can call 
> protected {{init()}} to load and publish fresh material. If loading fails, 
> the previous context, engines and sockets remain usable.
> * The snapshot contains immutable X.509 chains by private-key alias. An empty 
> map means the store has no such chains. A custom source that cannot report 
> its chains returns null metadata.
> * Serialization keeps the configuration. Restoring a serialized factory 
> reloads material on first use.
> h3. Compatibility
> Update and recompile subclasses that override {{create()}}, implement the old 
> {{createKeyManagers()}} hook or use the protected {{sslCtx}} field. A 
> subclass can still supply a null key store for a client without its own key. 
> Unknown protocol or cipher suite names now fail at first initialization, 
> including node startup. See the [subclass migration 
> guide|https://github.com/anton-vinogradov/ignite/blob/ignite-29209/docs/_docs/security/ssl-tls.adoc#migrating-an-existing-factory].
> [PR #13751 and validation|https://github.com/apache/ignite/pull/13751].



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to