Repository navigation
Conversation
Motivation: New public APIs should state the version they first appear in. Modification: Add @SInCE 2.1.0 to BouncyCastleConnectionContext and each of its public members, in the scaladsl and the javadsl. Result: The API docs show when the module's APIs were added. Tests: - Not run - scaladoc only; scalafmt run on the changed files References: Refs apache#2040
a2f774c to
76a2c7e
Compare
|
Thanks, and user can use https://github.com/google/conscrypt/ for performance |
| engine match { | ||
| case bcEngine: BCSSLEngine => | ||
| val params = bcEngine.getParameters | ||
| params.setNamedGroups(namedGroups) |
There was a problem hiding this comment.
Setting the list is not enough to make this a server preference. BCJSSE 1.87 defaults to peer order unless local named-group ordering is enabled (ContextData). The current tests prove that the server can use a hybrid group when that is the only common option, not that its preference wins under shared alternatives. Please either set the server-side ordering explicitly and test the negotiated policy, or document the server value as an allowlist with provider/peer negotiation policy, rather than promising hybrid-first selection.
There was a problem hiding this comment.
Fixed in 0937ba5. Server contexts now call BCSSLParameters.setUseNamedGroupsOrder(true), so the server selects the first group of its own list that the client supports.
Tests added in BouncyCastleConnectionContextSpec, using a Conscrypt 2.10 client (test dependency) because it reports the negotiated group and BCJSSE does not:
- the default server negotiates
X25519MLKEM768with it - a server configured with
x25519, X25519MLKEM768negotiatesx25519, although the client prefers the hybrid. Without the ordering change this test fails with"x25519mlkem768" did not equal "x25519".
|
|
||
| SSLContext clientSslContext = | ||
| BouncyCastleConnectionContext.createSSLContext(null, null, trustStore); | ||
| // only connects to servers that support ML-KEM |
There was a problem hiding this comment.
Please narrow this example's “only connects” promise to TLS 1.3, or expose and test an explicit TLS-1.3-only policy for strict ML-KEM use. The factory configures named groups on a generic TLS context without pinning the TLS version; RFC 10024 defines these groups for TLS 1.3. In the positive integration test, please also assert the negotiated TLS version (and group if the provider exposes it), not just the HTTP status.
There was a problem hiding this comment.
Fixed in 0937ba5, by adding the explicit policy rather than only narrowing the comment.
- New
httpsServerRequiringMlKem/httpsClientRequiringMlKemin both DSLs only enable TLS 1.3 and only allow the ML-KEM groups. The docs example now useshttpsClientRequiringMlKem. - The scaladoc of the named-group overloads says that the list does not restrict the TLS version and that a TLS 1.2 connection never uses a hybrid group.
- Tests: the positive cases assert
TLSv1.3(the Java test reads it from the server's SSL session), the negotiated group is asserted through a Conscrypt client, and TLS 1.2-only JDK peers are accepted by the default contexts and refused by theRequiringMlKemones, in both directions.
|
|
||
| * Create the `SSLContext` with `BouncyCastleConnectionContext.createSSLContext`. Bouncy Castle cannot use every key | ||
| that a key manager of the JDK's own TLS provider selects, and an `SSLContext` of another provider is rejected. | ||
| * Bouncy Castle only matches a host name against the subject alternative names of a certificate. A certificate that |
There was a problem hiding this comment.
Please qualify SAN-only identity checking as the BCJSSE default, consistent with RFC 9525. Provider 1.87 also documents an optional legacy compatibility setting, which this adapter does not override. Passing provider instances explicitly avoids registration but does not make provider policy independent of process configuration.
There was a problem hiding this comment.
Reworded in 0937ba5. The docs now say that matching subject alternative names only is the Bouncy Castle default, in line with RFC 9525, and that Bouncy Castle documents a system property restoring the legacy behaviour which this module does not set or override. The neighbouring bullet, and the scaladoc, now say that not registering the providers does not make their policy independent of the process configuration: they still read the system and security properties Bouncy Castle documents.
| .dependsOn(http, httpCore, httpTestkit % "test") | ||
| .enablePlugins(BootstrapGenjavadoc) | ||
|
|
||
| lazy val httpBouncyCastle = project("http-bouncycastle") |
There was a problem hiding this comment.
Before merging, could the PMC confirm whether this new module is covered by the ASF cryptography process, including the export/source listing, notification and user-facing notice where applicable? This is separate from the dependency license: the guidance also covers software designed to use a third-party crypto API, even if the library is not bundled.
There was a problem hiding this comment.
Pekko HTTP does not ship cryptography code in this module. Bouncy Castle does, and it is an ordinary dependency that is not bundled in our artifacts. The module only passes named-group and protocol settings to a JSSE provider, in the same way the rest of Pekko HTTP already drives the JDK's TLS through SSLContext and SSLEngine.
| ## ML-KEM key exchange with Bouncy Castle | ||
|
|
||
| A hybrid ML-KEM key exchange for TLS 1.3, such as `X25519MLKEM768`, protects recorded traffic against being decrypted | ||
| later by a quantum computer. The JDK's own TLS implementation supports it from JDK 27. On older JDKs, the |
There was a problem hiding this comment.
Could we phrase this in terms of runtime/JSSE capability rather than JDK major version? Oracle JDK 25.0.5 already ships all three hybrid TLS 1.3 groups (JDK-8314323). This module is useful when the runtime's JSSE provider does not offer these groups (including the project's JDK 17 baseline), but is not needed solely for hybrid key exchange on every pre-27 JDK. Please align the PR motivation with the guide.
There was a problem hiding this comment.
Reworded in 0937ba5, and the PR description is updated to match. The section is now "ML-KEM key exchange" and starts from the capability of the runtime's JSSE provider: JDK 27 supports the hybrid groups, some vendors ship them in update releases of earlier JDKs, and if the runtime has them the plain ConnectionContext factories are all that is needed. The module is described as an option where the runtime does not offer them, including the JDK 17 baseline.
Follow-up checklist for #2040Please address these points in the next revision. The inline threads have the code locations; this checklist separates behavior, tests, and release work.
When ready, please link the new commit and the focused handshake results, with the protocol and group actually observed. |
Motivation: Review of apache#2040 found that the module promised more than it configured. BCJSSE selects the key exchange group by the client's order unless local ordering is enabled, so the server did not prefer ML-KEM. The named groups do not restrict the TLS version, so "only ML-KEM" was not a guarantee. The docs also tied the need for the module to the JDK major version rather than to what the runtime's TLS provider supports. Modification: - Server contexts enable BCJSSE's local named-group ordering, so the server selects the first group of its list that the client supports. - Add httpsServerRequiringMlKem and httpsClientRequiringMlKem to both DSLs. They only enable TLS 1.3 and only allow the ML-KEM groups. - Scaladoc states that a named-group list does not restrict the TLS version. - Tests assert the negotiated TLS version, and the negotiated group through a Conscrypt client (test dependency), which reports it. Add tests for TLS 1.2 peers against the default and the strict contexts. The Java test reads the TLS version from the server's SSL session. - Docs: describe the need by JSSE capability, describe the two policies, qualify SAN-only host name matching as the BCJSSE default, note that provider policy still follows process configuration, and add a Conscrypt section. Result: A server context prefers ML-KEM over a client's own ordering, and an application can require TLS 1.3 with ML-KEM on either side. Tests: - sbt "http-bouncycastle/Test/testOnly org.apache.pekko.http.bouncycastle.scaladsl.BouncyCastleConnectionContextSpec org.apache.pekko.http.bouncycastle.javadsl.BouncyCastleConnectionContextTest": 20 passed (Scala 2.13, JDK 17) - The server-order test fails without the ordering change: "x25519mlkem768" did not equal "x25519" - scalafmt, javafmtAll and headerCheckAll run for the module - Scala 3, the docs build and other modules are left to CI References: Refs apache#2040
|
Thanks. Conscrypt needs no code on our side: I ran the Pekko HTTP server and client over a Conscrypt 2.10 0937ba5 adds a Conscrypt section to the HTTPS docs with what a user needs to know: use Conscrypt's own |
|
@He-Pin I'm completely reworking this and dropping the new module. The updated PR will just be docs and test code referenced by the docs with worked examples based on Bouncycastle and Conscrypt. |
Motivation: A hybrid ML-KEM key exchange for TLS 1.3 (RFC 10024) protects recorded traffic against later decryption by a quantum computer. Whether Pekko HTTP can use one depends on the JSSE provider of the Java runtime, and many runtimes, including the JDK 17 baseline, do not support it. Pekko HTTP accepts the SSLContext or SSLEngine of any provider, so this needs documentation, not a module. Modification: - Add an "ML-KEM key exchange" section to the server HTTPS page, with a pointer from the client HTTPS page. It covers when a runtime needs another provider, how the order of the named groups works on the server and the client, why a group list does not restrict the TLS version, and the pitfalls of each provider. - Add complete Scala and Java examples for Bouncy Castle (BCJSSE) and Conscrypt that users can copy, with usage examples. - Run the examples as tests in the docs project. Bouncy Castle 1.87 and Conscrypt 2.10.0 are test dependencies of the docs project only. Result: Users can serve and call HTTPS over an ML-KEM key exchange on JDK 17 or later by copying a documented example. Pekko HTTP gains no module, API or runtime dependency. Tests: - sbt "docs/Test/testOnly docs.http.scaladsl.MlKemTlsExamplesSpec docs.http.javadsl.MlKemTlsExamplesDocTest": 47 passed (Scala 2.13, JDK 17) - sbt docs/paradox: passed - scalafmt, docs/javafmtAll and docs/headerCheckAll run - Scala 3 and the other modules are left to CI References: Refs apache#2040, apache#1409
0937ba5 to
c93dd31
Compare
|
Change of direction in c93dd31: the Pekko HTTP already accepts the
The earlier review points still apply to the examples and are covered by the same tests. Pekko HTTP gains no module, public API or runtime dependency, and |
He-Pin
left a comment
There was a problem hiding this comment.
Re-reviewed the docs-only revision. Moving the providers to the documentation test classpath, pinning TLS 1.3 for strict BCJSSE, and checking actual group preference address the main design concerns from the earlier revision. The remaining issues below are about what the examples and their negative checks establish.
| * Like Bouncy Castle, Conscrypt only matches a host name against the subject alternative names of a certificate. | ||
| * This example prefers ML-KEM and does not require it: a peer that only offers classical groups still connects. | ||
| To change the named groups of an `SSLEngine`, Conscrypt relies on `SSLParameters.setNamedGroups`, which needs | ||
| JDK 20 or later. On older JDKs you get the default groups of Conscrypt and cannot refuse peers without ML-KEM. |
There was a problem hiding this comment.
This conflates the JDK's per-engine SSLParameters API with what the provider can enforce. In Conscrypt 2.10.0's NativeSsl initialization, the provider consults the process-wide jdk.tls.namedGroups property when no per-engine override was supplied; that branch is not gated on JDK 20. Please say that the example uses provider defaults and cannot set a per-engine policy through the standard Java API on JDK 17. The process-level setting is a distinct deployment scope and should not be described as impossible.
There was a problem hiding this comment.
You're right, corrected in 6c6d9ec. I confirmed it with Conscrypt 2.10.0 on JDK 17: with -Djdk.tls.namedGroups=x25519 a default engine pair negotiates X25519 instead of X25519MLKEM768.
The docs now make two separate statements: the example uses Conscrypt's default groups and cannot set a policy for a single SSLEngine on JDK 17, because SSLParameters.setNamedGroups needs JDK 20; and Conscrypt reads the jdk.tls.namedGroups system property on any JDK when an engine has no groups of its own, which is a process-wide deployment setting that the other JSSE providers read too.
| try | ||
| // the certificate is issued for localhost only | ||
| Http().singleRequest(HttpRequest(uri = s"https://127.0.0.1:${binding.localAddress.getPort}/"), | ||
| connectionContext = requiringClient).failed.futureValue |
There was a problem hiding this comment.
This can pass without reaching hostname verification. The listener binds to localhost, while the client dials 127.0.0.1; on a system where the bind resolves to ::1, connection refusal satisfies failed.futureValue as well. The Conscrypt case below has the same shape. Please keep the TCP address fixed, demonstrate a successful handshake on the same listener with the matching reference identity, then vary only the reference identity and assert a certificate/endpoint-verification failure rather than an arbitrary failed request. This is the identity check in RFC 9525, separate from trust and transport.
There was a problem hiding this comment.
Fixed in 6c6d9ec, for the Bouncy Castle and the Conscrypt cases.
- Every listener in the spec now binds to
127.0.0.1, and the client dials that address through aClientTransport, so the TCP address is fixed and only the reference identity varies. verifiesHostNameuses one listener: a request checked againstlocalhostcompletes over TLS 1.3, then the same client againstother.examplemust fail with aCertificateExceptionin the cause chain whose message is about the subject alternative names. A refused connection or any other failure no longer passes.
| } | ||
|
|
||
| "keep the named groups when HTTP/2 configures the engines for ALPN" in { | ||
| exchange(server(mlKemGroups), client(ClassicalGroups), http2 = true).failed.futureValue |
There was a problem hiding this comment.
The test name says this proves that ALPN preserves each engine's named groups, but any failed request currently passes. A bind/transport error, timeout, unrelated TLS failure or HTTP/2 negotiation error would all look the same here. Please assert a TLS handshake rejection caused by the incompatible policies (allow provider-specific alert wording), and keep a successful, policy-matched HTTP/2 exchange as the control. The positive group-preference check above is good evidence for the positive case; it does not prove the reason for these failures.
There was a problem hiding this comment.
Fixed in 6c6d9ec.
- The negative checks no longer accept any failed request. They require an
SSLExceptionin the cause chain that names the alert:handshake_failurefor incompatible groups andprotocol_versionfor the TLS 1.2 cases. The match is on the alert name only, since BCJSSE, SunJSSE and Conscrypt word their messages differently. - The ALPN test now starts with its control: the same server and client factories complete an HTTP/2 exchange over TLS 1.3 when their groups match (ML-KEM on both sides, and classical on both sides), and are then refused with
handshake_failurewhen the groups do not overlap.
Motivation: Review of apache#2040 found that the negative checks of the ML-KEM examples passed on any failed request, that the host name check dialled a different address than the listener was bound to, and that the docs described Conscrypt's named groups as unchangeable before JDK 20. Modification: - Bind every test listener to 127.0.0.1 and dial that address through a client transport, so that only the host name the certificate is checked against varies. - The host name test first completes a handshake on the same listener with the matching name, then asserts a CertificateException about the subject alternative names for another name. - Group and TLS version mismatches assert a TLS failure that names the handshake_failure or protocol_version alert. - The HTTP/2 ALPN test adds successful exchanges with matching groups as its control. - Docs: the Conscrypt example uses provider defaults and cannot set a per-engine policy on JDK 17; jdk.tls.namedGroups is a separate, process-wide setting that Conscrypt reads on any JDK. Result: The negative tests fail for the reason they name, and the Conscrypt notes separate the per-engine API from the process-level property. Tests: - sbt "docs/Test/testOnly docs.http.scaladsl.MlKemTlsExamplesSpec docs.http.javadsl.MlKemTlsExamplesDocTest": 47 passed (Scala 2.13, JDK 17) - sbt docs/paradox: passed - scalafmt run on the changed file References: Refs apache#2040
| The list of named groups and the `tls13Only` flag give you two policies: | ||
|
|
||
| * **Prefer ML-KEM.** With @scala[`PreferMlKemGroups`]@java[`PREFER_ML_KEM_GROUPS`] and `tls13Only` off, ML-KEM is | ||
| used whenever the peer supports it. A peer without ML-KEM, or one that only supports TLS 1.2, can still connect |
There was a problem hiding this comment.
The preference is not a guarantee in both roles. A client can offer ML-KEM first, but a peer server that also supports it can select a mutually supported classical group. The new negative control for client ordering in MlKemTlsExamplesSpec (the server selects x25519 while the Conscrypt client supports and prefers ML-KEM) demonstrates this distinction.
Could you scope this sentence to the example BCJSSE server using its own order, when TLS 1.3 and a hybrid group are mutually enabled, and state that the preferring client advertises a preference but does not control the selection? Keep “Require ML-KEM” as the explicit guarantee. RFC 8446 §§4.2.7–4.2.8 and RFC 10024 §4 do not require hybrid-first selection.
There was a problem hiding this comment.
Fixed in d695265. The "Prefer ML-KEM" bullet is now scoped to the example server: it selects an ML-KEM group when the client offers one that the server has enabled and the connection uses TLS 1.3. It then says that a client with this policy only advertises a preference, that a server supporting ML-KEM may still select a classical group both sides have enabled, and that the policy is not a guarantee. "Require ML-KEM" (TLS 1.3 only, hybrid groups only) is named as the policy to use for the guarantee and is otherwise unchanged.
No test change was needed: select the group by the server's order of preference, not the client's already covers the client side of this (the server selects x25519 while the Conscrypt client prefers ML-KEM), and it passes for the Scala and the Java example.
| offers classical groups still connects. The example cannot set a policy for a single `SSLEngine` on JDK 17, | ||
| because the standard API for that, `SSLParameters.setNamedGroups`, needs JDK 20 or later. | ||
| * Conscrypt also reads the `jdk.tls.namedGroups` system property when an engine has no groups of its own, on any | ||
| JDK. That is a setting for the whole process, which the other JSSE providers in it read as well, so it is a |
There was a problem hiding this comment.
The scope correction here is useful. Please narrow the last clause: this is a process-wide setting and it can also affect other providers that honor it; there is no portable requirement that every JSSE provider read this property. The fallback when no per-engine override was supplied is confirmed specifically for Conscrypt 2.10.0.
There was a problem hiding this comment.
Fixed in d695265. The bullet now says that the tested version of Conscrypt reads jdk.tls.namedGroups when an engine has no groups of its own, that the property is a setting for the whole process, and that it also affects any other JSSE provider in the process that honors it, which providers are not required to do. It starts with "Separately from that API" to keep it apart from the previous bullet about SSLParameters.setNamedGroups on a single engine.
The SAN bullet for Conscrypt is reworded too: it is the default of the tested version, the client example leaves endpoint identification enabled and does not change that default, and a hybrid key exchange does not replace the check because the server is still authenticated by its certificate. Docs only, so no test change.
Review checklist at 6c6d9ecThe docs-only approach is a good fit for Pekko’s existing connection contexts: no new published module, default, or provider dependency for applications. The current source addresses the earlier server order, strict TLS, and endpoint-identity concerns; please keep the actual negotiated-group and positive HTTP/2 controls.
Source review only here; no approval on this revision. |
Motivation: A hybrid ML-KEM key exchange for TLS 1.3 (RFC 10024) protects recorded traffic against later decryption by a quantum computer. Whether Pekko HTTP can use one depends on the JSSE provider of the Java runtime, and many runtimes, including the JDK 17 baseline, do not support it. Pekko HTTP accepts the SSLContext or SSLEngine of any provider, so this needs documentation, not a module. Modification: - Add an "ML-KEM key exchange" section to the server HTTPS page, with a pointer from the client HTTPS page. It covers when a runtime needs another provider, how the order of the named groups works on the server and the client, why a group list does not restrict the TLS version, and the pitfalls of each provider. - Add complete Scala and Java examples for Bouncy Castle (BCJSSE) and Conscrypt that users can copy, with usage examples. - Run the examples as tests in the docs project. Bouncy Castle 1.87 and Conscrypt 2.10.0 are test dependencies of the docs project only. Result: Users can serve and call HTTPS over an ML-KEM key exchange on JDK 17 or later by copying a documented example. Pekko HTTP gains no module, API or runtime dependency. Tests: - sbt "docs/Test/testOnly docs.http.scaladsl.MlKemTlsExamplesSpec docs.http.javadsl.MlKemTlsExamplesDocTest": 47 passed (Scala 2.13, JDK 17) - sbt docs/paradox: passed - scalafmt, docs/javafmtAll and docs/headerCheckAll run - Scala 3 and the other modules are left to CI References: Refs apache#2040, apache#1409
Motivation: Review of apache#2040 found that the negative checks of the ML-KEM examples passed on any failed request, that the host name check dialled a different address than the listener was bound to, and that the docs described Conscrypt's named groups as unchangeable before JDK 20. Modification: - Bind every test listener to 127.0.0.1 and dial that address through a client transport, so that only the host name the certificate is checked against varies. - The host name test first completes a handshake on the same listener with the matching name, then asserts a CertificateException about the subject alternative names for another name. - Group and TLS version mismatches assert a TLS failure that names the handshake_failure or protocol_version alert. - The HTTP/2 ALPN test adds successful exchanges with matching groups as its control. - Docs: the Conscrypt example uses provider defaults and cannot set a per-engine policy on JDK 17; jdk.tls.namedGroups is a separate, process-wide setting that Conscrypt reads on any JDK. Result: The negative tests fail for the reason they name, and the Conscrypt notes separate the per-engine API from the process-level property. Tests: - sbt "docs/Test/testOnly docs.http.scaladsl.MlKemTlsExamplesSpec docs.http.javadsl.MlKemTlsExamplesDocTest": 47 passed (Scala 2.13, JDK 17) - sbt docs/paradox: passed - scalafmt run on the changed file References: Refs apache#2040
Motivation: Review of the ML-KEM docs found two claims that were wider than what the examples establish: that the prefer policy uses ML-KEM whenever the peer supports it, and that every JSSE provider reads jdk.tls.namedGroups. Modification: - Scope the prefer policy to the example server selecting by its own order under TLS 1.3, and say that a preferring client only advertises a preference. Name the require policy as the guarantee. - Describe jdk.tls.namedGroups as a process-wide setting that affects other providers only if they honor it, separate from the per-engine SSLParameters API. - Describe SAN-only host name matching as the default of the tested Conscrypt version, which the example leaves unchanged. - Remove the unused copies of the example dependencies from Dependencies.Test, the docs project uses Dependencies.Docs. Result: The docs promise only what the examples and their tests show, and the build shows the example dependencies as docs-only. Tests: - sbt "docs/Test/testOnly docs.http.scaladsl.MlKemTlsExamplesSpec docs.http.javadsl.MlKemTlsExamplesDocTest": 47 passed (Scala 2.13, Temurin 17.0.20.1, macOS, Bouncy Castle 1.87, Conscrypt 2.10.0) - scalafmt --list --mode diff-ref=upstream/main: clean - git diff --check: clean - Not run locally, left to CI: docs/paradox, Scala 3 build, other modules References: Refs apache#2040
6c6d9ec to
d695265
Compare
|
Update for the checklist at 6c6d9ec6, in d695265 (branch rebased onto the current
Focused test run at d695265:
|
He-Pin
left a comment
There was a problem hiding this comment.
The latest server/client preference and Conscrypt property-scope edits address my earlier points. Two narrower issues remain: the native-JSSE guidance overstates when defaults are sufficient, and the Conscrypt HTTP/2 test does not observe the negotiated group.
| Whether you need to do anything depends on the TLS implementation (the JSSE provider) of your Java runtime, not only | ||
| on its major version. JDK 27 supports the hybrid groups and prefers `X25519MLKEM768` by default | ||
| ([JEP 527](https://openjdk.org/jeps/527)), and some vendors ship the same support in update releases of earlier JDKs. | ||
| If your runtime supports them, the plain `ConnectionContext.httpsServer` and `ConnectionContext.httpsClient` are all |
There was a problem hiding this comment.
Could we distinguish ‘the provider implements these groups’ from ‘these groups are enabled by the effective TLS policy’? A runtime can support ML-KEM and still have it excluded from the enabled groups, or negotiate a classical group with a peer. The plain ConnectionContext overloads inherit provider policy; they do not enable or require ML-KEM. Please say when the plain overloads are sufficient (TLS 1.3 and a hybrid group enabled with a compatible peer), and point users who need a guarantee to explicit provider policy and verification of the negotiated group.
|
|
||
| "complete HTTP/1.1 and HTTP/2 requests over TLS 1.3" in { | ||
| exchange(server, client).futureValue shouldEqual Exchange("HTTP/1.1", "TLSv1.3") | ||
| exchange(server, client, http2 = true).futureValue shouldEqual Exchange("HTTP/2.0", "TLSv1.3") |
There was a problem hiding this comment.
This checks HTTP/2 and TLS 1.3, but both can succeed with classical X25519. The group probe at groupNegotiatedWith currently uses exchange with its default http2 = false, so it only observes the HTTP/1.1 path. Can we also assert the negotiated group on the actual HTTP/2 connection under Conscrypt defaults, using the engine from that connection (or a controlled hybrid-only peer)? Please keep the existing endpoint-identity and HTTP/2 assertions.
|
Two follow-ups on
References: RFC 9846 §§4.3.7–4.3.8 separates supported groups from the selected key share, RFC 10024 §4 defines the hybrid shares, and RFC 7301 §3 defines ALPN, which selects the application protocol, not a key-exchange group. Netty 4.2's SSL builder similarly treats TLS provider and application-protocol configuration separately. RFC 9525 endpoint identity checks should remain unchanged. The provider-order and process-wide property edits in this head address the earlier feedback. |
Motivation
A hybrid ML-KEM key exchange for TLS 1.3 (RFC 10024) protects recorded traffic against later decryption by a quantum computer. Whether the Pekko HTTP server and client can use one depends on the JSSE provider of the Java runtime: JDK 27 supports the hybrid groups (JEP 527) and some vendors ship them in update releases of earlier JDKs, but many runtimes, including the project's JDK 17 baseline, do not.
Pekko HTTP already accepts the
SSLContextorSSLEngineof any provider, so users on such runtimes need documentation, not a new module. This PR originally added apekko-http-bouncycastlemodule; it is now docs and tested examples only.Modification
server-https-support.md, with a pointer fromclient-https-support.md. It covers:setUseNamedGroupsOrder(true)is set, and a client only offersBouncyCastleTls) and Conscrypt (ConscryptTls), plus usage examples that bind a server and send a request.docstest sources and run as tests. Bouncy Castle 1.87 (bcprov,bctls,bcpkix) and Conscrypt 2.10.0 are test dependencies of thedocsproject only; their versions are shown in the docs through Paradox properties.No module, public API, runtime dependency or default changes.
Result
Users can serve and call HTTPS over an ML-KEM key exchange on JDK 17 or later, for HTTP/1.1 and HTTP/2, by copying a documented and tested example.
Tests
sbt "docs/Test/testOnly docs.http.scaladsl.MlKemTlsExamplesSpec docs.http.javadsl.MlKemTlsExamplesDocTest": 47 passed (Scala 2.13, JDK 17).MlKemTlsExamplesSpecruns the same cases against the Scala and the Java example:X25519MLKEM768, and the server's order winning over the client'sjava.security.SecurityX25519MLKEM768by default, interoperation with a Bouncy Castle client that requires ML-KEMsbt docs/paradox: passed.scalafmt,docs/javafmtAllanddocs/headerCheckAllrun.References
None - follows the ML-KEM recommendation proposed in #1409