[GH-ISSUE #273] Client certs also specify Server usage #177

Open
opened 2026-02-25 22:32:48 +03:00 by kerem · 3 comments
Owner

Originally created by @travisgroth on GitHub (Jun 29, 2020).
Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/273

Using the -client flag results in a certificate valid for both Client and Server usage. This can lead to some unexpected validation scenarios. I think they should be mutually exclusive in practice.

Originally created by @travisgroth on GitHub (Jun 29, 2020). Original GitHub issue: https://github.com/FiloSottile/mkcert/issues/273 Using the `-client` flag results in a certificate valid for both Client and Server usage. This can lead to some unexpected validation scenarios. I think they should be mutually exclusive in practice.
Author
Owner

@FiloSottile commented on GitHub (Oct 25, 2020):

mTLS certificates are often used for both the client and server sides. What's a use case where the extra serverAuth usage is a problem rather than just superfluous?

<!-- gh-comment-id:716187181 --> @FiloSottile commented on GitHub (Oct 25, 2020): mTLS certificates are often used for both the client and server sides. What's a use case where the extra serverAuth usage is a problem rather than just superfluous?
Author
Owner

@travisgroth commented on GitHub (Oct 25, 2020):

If you're using mkcert for test certificates, you can unintentionally write code that is only validating the client certificate against Server usage, and looks correct until faced with real world client-only certs. This is the scenario I encountered.

I'm not sure I've directly seen any client certs also marked for server usage, but you are correct; that probably happens in mTLS services that aren't on the edge of a system. Maybe it's best to have additional control over both usages. The least surprising behavior would probably be:

  • if no usage flags passed, default to server
  • if usage flags are set, only set the ones present. eg, current behavior would require --client and --server
<!-- gh-comment-id:716220334 --> @travisgroth commented on GitHub (Oct 25, 2020): If you're using mkcert for test certificates, you can unintentionally write code that is only validating the client certificate against Server usage, and looks correct until faced with real world client-only certs. This is the scenario I encountered. I'm not sure I've directly seen any client certs also marked for server usage, but you are correct; that probably happens in mTLS services that aren't on the edge of a system. Maybe it's best to have additional control over both usages. The least surprising behavior would probably be: - if no usage flags passed, default to server - if usage flags are set, only set the ones present. eg, current behavior would require `--client` and `--server`
Author
Owner

@moparisthebest commented on GitHub (Mar 24, 2022):

The real issue is that server certs should set client usage too, to match LetsEncrypt (and most other CAs ?)

<!-- gh-comment-id:1077027548 --> @moparisthebest commented on GitHub (Mar 24, 2022): The real issue is that [server certs should set client usage too](https://github.com/FiloSottile/mkcert/pull/274#issuecomment-1077026786), to match LetsEncrypt (and most other CAs ?)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mkcert#177
No description provided.