From 5f9df63658190da7ee499ac1ea8c9fc372d1be04 Mon Sep 17 00:00:00 2001 From: kenwer <72459348+kenwer@users.noreply.github.com> Date: Tue, 6 Oct 2020 17:50:12 +0200 Subject: [PATCH] Add SAN field to the x509 certificate Add SAN field to the x509 certificate so it doesn't rely just on legacy Common Name field. This prevents a TLS connection error on modern environments. --- golang/examples/tls_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/golang/examples/tls_test.go b/golang/examples/tls_test.go index b6af470..8da65fe 100644 --- a/golang/examples/tls_test.go +++ b/golang/examples/tls_test.go @@ -60,6 +60,7 @@ func createECDSASelfSignedCert(privKey *util.EP11PrivateKey, commonName string, Subject: pkix.Name{ CommonName: commonName, }, + DNSNames: []string{commonName}, NotBefore: time.Now(), NotAfter: time.Now().Add(time.Hour * 24 * 180), }