Skip to content

Commit

Permalink
Bugfix selfsign to actually include the common name
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed Apr 14, 2022
1 parent 0afe323 commit de5976d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/crypto/selfsign/selfsign.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/hex"
"errors"
"math/big"
Expand Down Expand Up @@ -85,6 +86,9 @@ func WithDNS(key crypto.PrivateKey, cn string, sans ...string) (tls.Certificate,
Version: 2,
IsCA: true,
DNSNames: names,
Subject: pkix.Name{
CommonName: cn,
},
}

raw, err := x509.CreateCertificate(rand.Reader, &template, &template, pubKey, key)
Expand Down

0 comments on commit de5976d

Please sign in to comment.