summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se (leap communications)>2019-07-05 19:07:12 +0200
committerKali Kaneko <kali@leap.se (leap communications)>2019-07-05 19:07:12 +0200
commitba4d83dd8db90f77a861186801ac0fccd015aaef (patch)
treec62626f5d0cde250c01daaa18b1ad7ea457a8c67
parent159b4322aeb0d4decb584a2f55182b67c17bf6d0 (diff)
ignore the random string for now, pt only accepts UNLIMITED
-rw-r--r--certs.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/certs.go b/certs.go
index f53b322..1138ff1 100644
--- a/certs.go
+++ b/certs.go
@@ -17,7 +17,7 @@ const certPrefix = "UNLIMITED"
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz")
-func RandStringRunes(n int) string {
+func randStringRunes(n int) string {
b := make([]rune, n)
for i := range b {
b[i] = letterRunes[mrand.Intn(len(letterRunes))]
@@ -50,11 +50,14 @@ func (ci *caInfo) CertWriter(out io.Writer) {
subjectKeyID := make([]byte, 20)
rand.Read(subjectKeyID)
+ _ = randStringRunes(25)
// Prepare certificate
cert := &x509.Certificate{
SerialNumber: serialNumber,
+
Subject: pkix.Name{
- CommonName: certPrefix + RandStringRunes(25),
+ //CommonName: certPrefix + randStringRunes(25),
+ CommonName: certPrefix,
},
NotBefore: time.Now().AddDate(0, 0, -7),
NotAfter: time.Now().AddDate(0, 0, expiryDays),