Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones |
Member
Author
|
Closing this draft because the requested deliverable is the API proposal itself, before committing to an implementation. The proposal is now tracked in #134630. A prototype can follow after the API design discussion. Note This comment was created with GitHub Copilot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background and motivation
During a post-quantum cryptography rollout, servers need to keep classical certificates available while selectively offering ML-DSA certificates to compatible clients. Today,
ServerOptionsSelectionCallbackcan select a certificate based on SNI and advertised TLS versions, butSslClientHelloInfodoes not indicate which signature algorithm families the client advertised. Selecting an ML-DSA certificate unconditionally breaks classical clients, while always selecting RSA or ECDSA prevents gradual PQC deployment on the same endpoint.This proposal exposes a compact family-level view of the ClientHello
signature_algorithmsextension. It is intended as an allocation-free pre-filter for choosing among configured RSA, ECDSA, EdDSA, ML-DSA, and SLH-DSA certificate candidates. It deliberately does not claim that every certificate or chain in a reported family is compatible; the application must still apply its certificate policy.TLS signature algorithms are independent from TLS supported groups. Negotiated supported-group reporting, including hybrid ML-KEM groups, is tracked separately by #132239. Additional PQC
SslStreamtest coverage is tracked by #134227.The existing workaround is to use the experimental
TlsSessionraw ClientHello API and implement a TLS parser. NormalSslStream, Kestrel, and QUIC callback users cannot otherwise inspect this information.API proposal
Prototype: wfurt@21c91ef
API usage
The server controls preference ordering.
MLDsameans that the client advertised at least one recognized ML-DSA signature scheme; it does not mean that every ML-DSA parameter set or certificate chain is compatible.Alternative designs
Expose exact signature schemes
This is lossless and can distinguish ML-DSA parameter sets, RSA-PSS key forms, ECDSA curves, certificate-chain signature constraints, client ordering, and unknown schemes. However, it exposes substantially more TLS protocol detail, requires callers to implement family mapping and
signature_algorithms_certfallback semantics, and likely requires per-handshake storage for the lists. The proposed bitmask addresses the common certificate-family rollout policy without adding collection allocations. Exact scheme exposure can be added later if applications need to select among parameter sets rather than among families.Expose both
signature_algorithmsandsignature_algorithms_certas family maskssignature_algorithms_certconstrains signatures within the certificate chain, not simply the leaf key family. For example, an ECDSA leaf can be issued by an RSA CA. Reducing that extension to a second family mask could encourage callers to incorrectly require the leaf family in both masks. The proposal instead documents that the family mask is only a broad leaf/private-key compatibility signal.Expose raw ClientHello bytes
This is already available through the experimental
TlsSessionAPI. Requiring everySslStreamor Kestrel application to implement a security-sensitive TLS parser is not appropriate for the common selection scenario.Automatically choose from multiple certificates
Platform TLS providers differ in certificate-selection policy and do not receive equivalent candidate sets from
SslStreamtoday. ReusingServerOptionsSelectionCallbackkeeps server preference explicit and consistent across Schannel, OpenSSL, Apple TLS, and MsQuic.Include supported groups
Supported groups describe key exchange, while signature algorithms describe certificate authentication. This proposal does not add group requirements or enforcement. Negotiated-group reporting is covered by #132239.
Risks
None.SslClientHelloInfois shared bySslStream, experimentalTlsSession, andQuicListener; the prototype populates the property in all three paths.None.Usage in dotnet/runtime
Updated in the prototype
System.Net.Security/SslStream.IO.csServerOptionsSelectionCallback.System.Net.Security/TlsSession.csClientHelloInfofor deferred server options.System.Net.Quic/QuicListener.csConnectionOptionsCallback.No additional runtime adoption sites select among multiple certificates today.
Validation
Note
This proposal and prototype were created with GitHub Copilot.