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 May 20, 2024
1 parent 35b93e5 commit 7713fef
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 7713fef

Please sign in to comment.