Skip to content

Better client certificate support for TLS 1.3 #46120

Closed as not planned
Closed as not planned

Description

@tniessen

What is the problem this feature will solve?

tls.createServer() accepts a requestCert option that can be used to request client certificates. However, this option does not appear to be configurable through a SecureContext, so it cannot be changed dynamically (e.g., based on the hostname in SNICallback).

In TLS 1.2, tlsSocket.renegotiate() can be used to dynamically request a client certificate after the initial handshake.

TLS 1.3, on the other hand, does not allow this renegotiation. With the current API, I don't see a way of dynamically requesting client certificates in TLS 1.3.

What is the feature you are proposing to solve the problem?

I believe there are two viable approaches to dynamic client certificate requests, both of which should ideally be supported.

  • The server should be able to dynamically decide whether to request a client certificate based on the ClientHello message, similar to how the SNICallback allows dynamic selection of the SecureContext.
  • Post-handshake authentication can be enabled by the client and allows the server to request a client certificate after the handshake has been completed. This might need APIs on both sides.

I certainly don't want to add much complexity to the TLS module, nor do I want to bloat it with additional functions that are specific to this TLS version. I also don't know how this would tie in with QUIC.

What alternatives have you considered?

It is possible to manually parse the ClientHello message to dynamically decide which TLS server instance to pass the connection to. This is somewhat difficult to implement though.

Activity

  1. added
    tls
    feature request
    on Jan 6, 2023
  2. bnoordhuis commented on Jan 7, 2023

    @bnoordhuis
    Member

    Post-handshake authentication: https://www.rfc-editor.org/rfc/rfc8446#section-4.6.2

    But note that it is explicitly forbidden for HTTP/2: https://www.rfc-editor.org/rfc/rfc8740#section-3

    Also in TLSv1.2, by the way; renegotiation is only allowed up to the connection preface: https://www.rfc-editor.org/rfc/rfc7540#section-9.2.1

    I don't know about QUIC but after some quick googling I'm inclined to believe it follows HTTP/2. Maybe @jasnell knows.

  3. tniessen commented on Feb 13, 2023

    @tniessen
    MemberAuthor

    @bnoordhuis Thank you :) Is my understanding correct that dynamic decisions after the ClientHello (based on SNI and/or ALPN) would still be possible in HTTP/2 and QUIC?

  4. bnoordhuis commented on Feb 14, 2023

    @bnoordhuis
    Member

    ALPN and SNI still work the same, yes, but I expect SNI to be subsumed by ECH in a couple of years.

  5. tniessen commented on Jun 29, 2023

    @tniessen
    MemberAuthor

    @bnoordhuis Do you have an idea for a minimal API extension that would allow dynamically deciding whether to request a client certificate based on SNI/ALPN/future ECH?

  6. github-actions commented on Dec 27, 2023

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  7. added
    stale
    on Dec 27, 2023
  8. github-actions commented on Jan 27, 2024

    @github-actions
    Contributor

    There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requeststaletls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions