Skip to content

Commit 84b357f

Browse files
authored
Merge pull request #6929 from thaJeztah/stdlib_systempools
use stdlib's x509.SystemCertPool on Windows
2 parents 950401c + 0d32fde commit 84b357f

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

cmd/docker-trust/internal/registry/registry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ package registry
44
import (
55
"context"
66
"crypto/tls"
7+
"crypto/x509"
78
"fmt"
89
"net/http"
910
"os"
1011
"path/filepath"
1112

1213
"github.com/docker/distribution/registry/client/transport"
13-
"github.com/docker/go-connections/tlsconfig"
1414
"github.com/sirupsen/logrus"
1515
)
1616

@@ -48,7 +48,7 @@ func loadTLSConfig(ctx context.Context, directory string, tlsConfig *tls.Config)
4848
switch filepath.Ext(f.Name()) {
4949
case ".crt":
5050
if tlsConfig.RootCAs == nil {
51-
systemPool, err := tlsconfig.SystemCertPool()
51+
systemPool, err := x509.SystemCertPool()
5252
if err != nil {
5353
return invalidParam(fmt.Errorf("unable to get system cert pool: %w", err))
5454
}

internal/registry/registry.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package registry
44
import (
55
"context"
66
"crypto/tls"
7+
"crypto/x509"
78
"fmt"
89
"net"
910
"net/http"
@@ -74,7 +75,7 @@ func loadTLSConfig(ctx context.Context, directory string, tlsConfig *tls.Config)
7475
switch filepath.Ext(f.Name()) {
7576
case ".crt":
7677
if tlsConfig.RootCAs == nil {
77-
systemPool, err := tlsconfig.SystemCertPool()
78+
systemPool, err := x509.SystemCertPool()
7879
if err != nil {
7980
return invalidParam(fmt.Errorf("unable to get system cert pool: %w", err))
8081
}

0 commit comments

Comments
 (0)