aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index 7fee39e..455842d 100644
--- a/main.go
+++ b/main.go
@@ -20,6 +20,7 @@ import (
"math/big"
"net"
"os"
+ "sort"
"time"
)
@@ -167,6 +168,11 @@ func main() {
if country == "" {
log.Fatalln("error: -c is required")
}
+ // See RFC 6125ยง6.4.4.
+ if len(dnsNames) > 0 || len(ips) > 0 {
+ dnsNames = append(dnsNames, commonName)
+ }
+ sort.Strings(dnsNames)
if from.t.IsZero() {
from.t = time.Now()
}