Skip to content

Commit

Permalink
Fix TestRuntime_TLSAuthConfigWithLoadedCAPoolAndLoadedCA on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
  • Loading branch information
kzys committed Oct 14, 2021
1 parent a056c33 commit 1309bcd
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions client/runtime_test.go
Expand Up @@ -32,11 +32,12 @@ import (
"crypto/x509"
"encoding/pem"

"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/go-openapi/runtime"
goruntime "runtime"
)

// task This describes a task. Tasks require a content property to be set.
Expand Down Expand Up @@ -188,8 +189,14 @@ func TestRuntime_TLSAuthConfigWithLoadedCAPoolAndLoadedCA(t *testing.T) {
cert, err := x509.ParseCertificate(block.Bytes)
require.NoError(t, err)

pool, err := x509.SystemCertPool()
require.NoError(t, err)
var pool *x509.CertPool
if goruntime.GOOS == "windows" {
// Windows doesn't have the system cert pool.
pool = x509.NewCertPool()
} else {
pool, err = x509.SystemCertPool()
require.NoError(t, err)
}
startingCertCount := len(pool.Subjects())

var opts TLSClientOptions
Expand Down

0 comments on commit 1309bcd

Please sign in to comment.