Repository navigation
Set cert fields required by rust-spiffe workload api clients - #19
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the InMemoryCA implementation in pkg/spire-devserver/memory-ca.go to include NotBefore timestamps for both CA and SVID certificates, and adds basic constraints to SVIDs for better client compatibility. The review feedback recommends backdating the NotBefore fields by one minute to prevent 'not yet valid' errors caused by clock skew between systems, which is particularly important given the short four-minute lifetime of the SVIDs.
|
Thanks @glindstedt 🙂 Is it worth applying those 2 suggestions from Gemini do you think? Stops a small clock drift being a spurious issue in the future (unlikely if this is only used in dev - but code has a funny habit of propagating to production) |
|
@alec-w Yeah doesn't hurt, I'll apply them 👍 |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
alec-w
left a comment
There was a problem hiding this comment.
Contribution much appreciated 🙂
When using
rust-spiffe1 the Workload API client complained about the BasicConstraints extension being missing:SPIFFE spec does not require the
pathLenConstraintto be set, so we specify-1which means that it is unset.2When verifying the server certificate on the client side while setting up the mTLS connection it failed to parse the certificate with
BadEncoding. This turned out to be becauseNotBeforehad not been set, which prevented the certificate from even being parsed before it could be verified.Footnotes
https://github.com/maxlambrecht/rust-spiffe ↩
https://spiffe.io/docs/latest/spiffe-specs/x509-svid/#41-basic-constraints ↩