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.
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.Configdoes not have a means to configure the inspection of the URI SAN of a given certificate. A common workaround is to useServerNamewith 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
ExpectedSPIFFEIDor similar) totls.Config, which would be used by the client if provided in the config, and making the requisite handling changes in the verification process.