Skip to content
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: x509 DN ordering #11966

szechyjs opened this issue Jul 31, 2015 · 2 comments

crypto/x509: x509 DN ordering #11966

szechyjs opened this issue Jul 31, 2015 · 2 comments


Copy link

@szechyjs szechyjs commented Jul 31, 2015

It seems that ToRDNSequence creates a DN with a non standard ordering.

This produces a cert with the subject line: C=US, O=Example Org, OU=Security, L=City Name, ST=State,

Note how O and OU come before state and locality, and state and locality are in the wrong order.

Typically the subject lines use this ordering: C=US, ST=State, L=City Name, O=Example Org, OU=Security,

Some examples I've pulled from the web:

C=US, ST=California, L=Mountain View, O=Google Inc, CN=*
C=US, ST=California, L=San Jose, O=PayPal, Inc., OU=PayPal Production,
C=US, ST=CA, L=Menlo Park, O=Facebook, Inc., CN=*
C=US, ST=Washington, L=Seattle,, Inc.,
C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Certification Authority

Some EV Certs, which are probably outside the scope of this bug but I thought I would include them.,, businessCategory=Private Organization, serialNumber=2158113, C=US, postalCode=94043, ST=California, L=Mountain View, street=350 Ellis Street, O=Symantec Corporation, OU=Infrastructure Operations,
businessCategory=Private Organization,,, serialNumber=5157550, street=548 4th Street, postalCode=94107, C=US, ST=California, L=San Francisco, O=GitHub, Inc.,,, businessCategory=Private Organization, serialNumber=754401, C=US, postalCode=15222, ST=Pennsylvania, L=Pittsburgh, street=249 Fifth Ave., O=The PNC Financial Services Group, Inc., OU=Secure Edge Server - A,
@ianlancetaylor ianlancetaylor changed the title x509 DN ordering crypto/x509: x509 DN ordering Jul 31, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jul 31, 2015
Copy link

@ianlancetaylor ianlancetaylor commented Jul 31, 2015

CC @agl

@agl agl self-assigned this Aug 2, 2015
Copy link

@agl agl commented Aug 2, 2015

Yep, good point, thanks. scheduled for Go 1.6.

@agl agl closed this in 0cced63 Aug 30, 2015
@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.