-
Notifications
You must be signed in to change notification settings - Fork 289
Add CSR common name to SANs if no other SANs are defined in CSR #1172
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
Conversation
command/certificate/sign.go
Outdated
| if addCNSAN { | ||
| cnInSANs := false | ||
| for _, v := range sans { | ||
| if v == cr.Subject.CommonName { | ||
| cnInSANs = true | ||
| break | ||
| } | ||
| } | ||
| if !cnInSANs { | ||
| sans = append(sans, cr.Subject.CommonName) | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to do this only if there are no SANs.
command/certificate/sign.go
Outdated
| cli.BoolTFlag{ | ||
| Name: "add-cn-san", | ||
| Usage: `Ensure that Common Name from CSR subject is added to Subject Alternative | ||
| Name (SAN) extension of the certificate. This flag is enabled by default. To | ||
| disable default behavior pass the flag as '--add-cn-san=false'.`, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do something like --omit-cn-san as @hslatman suggested.
hslatman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😄
Co-authored-by: Mariano Cano <mariano.cano@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.