Skip to content

proposal: crypto/tls: Support for optional SPIFFEID in tls.Config #73389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jsnctl opened this issue Apr 15, 2025 · 3 comments
Closed

proposal: crypto/tls: Support for optional SPIFFEID in tls.Config #73389

jsnctl opened this issue Apr 15, 2025 · 3 comments
Labels
Milestone

Comments

@jsnctl
Copy link

jsnctl commented Apr 15, 2025

Proposal Details

The SPIFFE specification denotes that X.509 SVIDs should contain a single URI SAN entry containing a SPIFFEID for certificate verification purposes.

At the moment, tls.Config does not have a means to configure the inspection of the URI SAN of a given certificate. A common workaround is to use ServerName with an expected value of a DNS SAN, but it would be useful to be able to optionally verify the SPIFFEID of a returned certificate directly with the URI entry.

This could be achieved by adding a new field (something like ExpectedSPIFFEID or similar) to tls.Config, which would be used by the client if provided in the config, and making the requisite handling changes in the verification process.

@jsnctl jsnctl changed the title proposal: cyrpto/tls: Supoort for optional SPIFFEID in tls.Config proposal: cyrpto/tls: Support for optional SPIFFEID in tls.Config Apr 15, 2025
@jsnctl jsnctl changed the title proposal: cyrpto/tls: Support for optional SPIFFEID in tls.Config proposal: crypto/tls: Support for optional SPIFFEID in tls.Config Apr 15, 2025
@gopherbot gopherbot added this to the Proposal milestone Apr 15, 2025
@seankhliao
Copy link
Member

Given the existence of https://pkg.go.dev/github.com/spiffe/go-spiffe/v2@v2.5.0/spiffetls
I think this is out of scope for crypto/tls, which targets general Web usage.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2025
@jsnctl
Copy link
Author

jsnctl commented Apr 15, 2025

Thanks for the context @seankhliao. As an alternative, would a more generic URI SAN field (i.e. not SPIFFE specific) in the Config be more palatable?

@seankhliao
Copy link
Member

I think not, it's outside the target use case of web, and it can be done by combining InsecureSkipVerify with VerifyPeerCertoficate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants