1
0
mirror of https://github.com/docker/cli.git synced 2026-10-31 11:35:26 +03:00

Merge pull request #6929 from thaJeztah/stdlib_systempools

use stdlib's x509.SystemCertPool on Windows
This commit is contained in:
Sebastiaan van Stijn
2026-04-15 16:32:00 +02:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -4,13 +4,13 @@ package registry
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"net/http"
"os"
"path/filepath"
"github.com/docker/distribution/registry/client/transport"
"github.com/docker/go-connections/tlsconfig"
"github.com/sirupsen/logrus"
)
@@ -48,7 +48,7 @@ func loadTLSConfig(ctx context.Context, directory string, tlsConfig *tls.Config)
switch filepath.Ext(f.Name()) {
case ".crt":
if tlsConfig.RootCAs == nil {
systemPool, err := tlsconfig.SystemCertPool()
systemPool, err := x509.SystemCertPool()
if err != nil {
return invalidParam(fmt.Errorf("unable to get system cert pool: %w", err))
}

View File

@@ -4,6 +4,7 @@ package registry
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"net"
"net/http"
@@ -74,7 +75,7 @@ func loadTLSConfig(ctx context.Context, directory string, tlsConfig *tls.Config)
switch filepath.Ext(f.Name()) {
case ".crt":
if tlsConfig.RootCAs == nil {
systemPool, err := tlsconfig.SystemCertPool()
systemPool, err := x509.SystemCertPool()
if err != nil {
return invalidParam(fmt.Errorf("unable to get system cert pool: %w", err))
}