Skip to content

Self-signed certificates requested through CSR contain both server- and client usage #658

Description

@marc1404

Context & Description

When creating a self-signed Certificate using a certificate signing request (CSR), the key usage is set to the default:

ExtKeyUsage: DefaultCertExtKeyUsage,

The default is both server- and client usage:

// DefaultCertExtKeyUsage are the default Extended KeyUsage (letsencrypt default).
var DefaultCertExtKeyUsage []x509.ExtKeyUsage = []x509.ExtKeyUsage{
x509.ExtKeyUsageClientAuth,
x509.ExtKeyUsageServerAuth,
}

Strictly speaking, this default is also not correct anymore, as Let's Encrypt is moving to issuing certificates only with server usage:
https://letsencrypt.org/2025/05/14/ending-tls-client-authentication

However, when a self-signed Certificate is created without a CSR, it will only have server usage:

ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},

In short, there's an inconsistency in the key usage of self-signed Certificates depending on whether a CSR is used.

Tasks

  • Remove client usage from self-signed Certificates created through a CSR.
  • Review the default key usage and align with Let's Encrypt (can also be moved to a separate issue) [see also: ref].

Additional Information

Removing the client auth key usage should be treated as a breaking change and described in the release notes accordingly.

Activity

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

    kind/bugBuglifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions