Skip to content

Commit

Permalink
Emails take precidence for CN over URIs and IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefnoah committed Apr 27, 2024
1 parent b04ca54 commit 80ff285
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ func sign(iss *issuer, domains []string, ipAddresses []net.IP, emails []string,
var cn string
if len(domains) > 0 {
cn = domains[0]
} else if len(ipAddresses) > 0 {
cn = ipAddresses[0].String()
} else if len(emails) > 0 {
cn = emails[0]
} else if len(uris) > 0 {
cn = uris[0].String()
} else if len(ipAddresses) > 0 {
cn = ipAddresses[0].String()
} else {
return nil, fmt.Errorf("must specify at least one domain name or IP address")
}
Expand Down

0 comments on commit 80ff285

Please sign in to comment.