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
crypto/x509: CommonName truncated at slash #15256
Comments
Please provide a complete program demonstrating the problem. Also, please include the OpenSSL cert as well. |
Having some machine problems. Will report back in a few. |
|
@bradfitz sorry for the long delay. Finally got my machine back. Here's the sample code I was using. If you use openssl to check the CommonName of certPEM, you will see it properly reports it as |
The common name in the certPEM is 'client'. Please don't confuse what is printed by openssl with the actual structure of the certificate.
Common name and email address are separate |
@szank You're right about the oid of the emailAddress. Is that oid defined somewhere as a constant that's more human readable so that I can use in the code that says "when this sequence is an emailAddress, extract its value". |
OK, I just resorted to creating a []int{...} as emailAddressOID. I'm sure there's a better way than this, but this gets me over the problem for now. Closing it as this is not a problem with the x509 package. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.5 linux/amd64
go env
)?GOARCH="amd64"
GOHOSTOS="linux"
I created a client certificate with CN field set to "test/abc=1234"
chains, _ := mycert.Verify(options)
cn := chains[0].Subject.CommonName
, where mycert is the certificate I created in the above step. I was expecting
cn
to be set to "test/abc=1234"cn
was actually set to "test". I lost the trailing part.However, if I do a
openssl x509 -in mycert -text
, I can see the CN field is properly set to "test/abc=1234"The text was updated successfully, but these errors were encountered: