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/pkix: reorder Name.String to reduce visual noise [freeze exception] #39924

FiloSottile opened this issue Jun 29, 2020 · 2 comments


Copy link

@FiloSottile FiloSottile commented Jun 29, 2020

In Go 1.15 we fixed a bug in Name.String that would hide any non-standard attributes from the output.

Unfortunately, we are bound to the RFC 2253 format by the docs (#27401) and that format requires any non-standard attribute to be printed as a dotted OID and hex-encoded value (#33093). To reduce the disruption of these entries appearing in the output, we could put them at the end of the string so the human-readable part is at the beginning.

RFC 2253 lets us pick any order we like.

When converting from an ASN.1 RelativeDistinguishedName to a string, the output consists of the string encodings of each AttributeTypeAndValue (according to 2.3), in any order.

I'd like to ask for a freeze exception, as this is a small change based on feedback on the beta to reduce the disruption of a Go 1.15 change. /cc @rsc @golang/osp-team


RFC 4514

C = US, ST = CO, L = Boulder, O = Acme, OU = Eng, CN =, emailAddress =

Go 1.14,OU=Eng,O=Acme,L=Boulder,ST=CO,C=US

Go 1.15 (now)


Go 1.15 (proposed),OU=Eng,O=Acme,L=Boulder,ST=CO,C=US,1.2.840.113549.1.9.1=#0c0c656e674061636d652e636f6d

@FiloSottile FiloSottile added this to the Go1.15 milestone Jun 29, 2020
@FiloSottile FiloSottile changed the title crypto/x509/pkix: reorder Name.String to reduce visual noise (freeze exception) crypto/x509/pkix: reorder Name.String to reduce visual noise [freeze exception] Jun 30, 2020
Copy link

@andybons andybons commented Jun 30, 2020

Sounds good to me. Approved.

@dmitshur dmitshur added NeedsFix and removed NeedsDecision labels Jun 30, 2020
Copy link

@gopherbot gopherbot commented Jun 30, 2020

Change mentions this issue: crypto/x509/pkix: print non-standard parsed Names at the end

@gopherbot gopherbot closed this in 12debf4 Jul 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.