From 2ed07b446dc3ff314da815f6651051a3e7153157 Mon Sep 17 00:00:00 2001 From: raul Date: Thu, 23 May 2024 13:17:43 +0200 Subject: [PATCH] Fix DNSNames not being used --- cmd/generateFunc.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/generateFunc.go b/cmd/generateFunc.go index c893df2..d54aa3c 100644 --- a/cmd/generateFunc.go +++ b/cmd/generateFunc.go @@ -149,12 +149,12 @@ func generateCert(serNumber int, clientOrg string, clientCountry string, StreetAddress: []string{clientStreetAddr}, PostalCode: []string{clientPostCode}, }, - PermittedDNSDomains: []string{clientDomain}, - NotBefore: time.Now(), - NotAfter: time.Now().AddDate(clientNotAfter, 0, 0), - SubjectKeyId: []byte{1, 2, 3, 4, 6}, - ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, - KeyUsage: x509.KeyUsageDigitalSignature, + DNSNames: []string{clientDomain}, + NotBefore: time.Now(), + NotAfter: time.Now().AddDate(clientNotAfter, 0, 0), + SubjectKeyId: []byte{1, 2, 3, 4, 6}, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth}, + KeyUsage: x509.KeyUsageDigitalSignature, } certPrivKey, err := rsa.GenerateKey(rand.Reader, clientBitSize) @@ -208,7 +208,6 @@ func generateCert(serNumber int, clientOrg string, clientCountry string, Bytes: x509.MarshalPKCS1PrivateKey(certPrivKey), }) - log.Printf("Generating %v/.config/") fmt.Printf("Generating %v/.config/cert400/clientCertificates/"+clientDomain+".key...\n", home) clientkey, err := os.OpenFile(home+"/.config/cert400/clientCertificates/"+clientDomain+".key", os.O_WRONLY|os.O_CREATE, 0600) if err != nil {