fix nats TLS unit tests (#10476)

This commit fixes the nats TLS tests by generating new certificates
(root CA, server and client) - each valid for 10y. The new certificates
don't have a common name (deprecated by X.509) but SANs instead.

Since Go 1.15 the Go `crypto/x509` package rejects certificates that
only have a common name and no SAN. See: https://golang.org/doc/go1.15#commonname
This commit is contained in:
Andreas Auernhammer
2020-09-14 22:19:46 +02:00
committed by GitHub
parent 34ea1d2167
commit 224daee391
8 changed files with 46 additions and 142 deletions

View File

@@ -19,7 +19,6 @@ package target
import (
"path"
"path/filepath"
"runtime"
"testing"
xnet "github.com/minio/minio/pkg/net"
@@ -42,9 +41,6 @@ func TestNatsConnTLSCustomCA(t *testing.T) {
con, err := clientConfig.connectNats()
if err != nil {
if runtime.Version() == "go1.15" {
t.Skip()
}
t.Errorf("Could not connect to nats: %v", err)
}
defer con.Close()
@@ -68,9 +64,6 @@ func TestNatsConnTLSClientAuthorization(t *testing.T) {
con, err := clientConfig.connectNats()
if err != nil {
if runtime.Version() == "go1.15" {
t.Skip()
}
t.Errorf("Could not connect to nats: %v", err)
}
defer con.Close()