crypto/x509: should error if non-CA certificate contains name constraints #71795
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.23.2 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Perform certificate verification
go run go_verify.go
certs&program.zip
What did you see happen?
The execution result is passed verification
Certificate is valid!
What did you expect to see?
According to RFC 5280, Section 4.2.1.10, the Name Constraints extension is permitted only in CA certificates, not in end-entity certificates.
Cryptography fails to verify the certificate and throws the relevant error according to RFC5280: Certificate verification failed: validation failed: invalid extension: 2.5.29.30: Certificate contains prohibited extension
The text was updated successfully, but these errors were encountered: