Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
crypto/x509: unable to parse certificate parsable by Java #33259
What version of Go are you using (
@Freeaqingme This is a certificate generated from third-party sdk and the generate code is closed source.
I think this post will help: https://groups.google.com/forum/#!topic/golang-nuts/SCzlQPNfURk
Should crypto/x509 be lenient in parsing ?
Looking at that other thread, in the golang-nuts
The relevant code here is x509.ParseCertificate
If e.Value is a single byte, of value 0 as described, then attempt to Unmarshal would fail when it calls into parseTagAndLength
It appears that some leniency was added when iterating the array of distributionPoint per line 1504 of x509.go checking name. Perhaps some upfront checks on this field, and possibly others, for "empty value" type conditions could be added for leniency. Alternatively, giving clarity on the "truncated tag or length" for this specific condition in x509.go