diff --git a/docs/config_unix.go b/docs/config_unix.go index 32f167d0..df970181 100644 --- a/docs/config_unix.go +++ b/docs/config_unix.go @@ -8,7 +8,9 @@ const ( // DefaultV2Registry is the URI of the default v2 registry DefaultV2Registry = "https://registry-1.docker.io" +) +var ( // CertsDir is the directory where certificates are stored CertsDir = "/etc/docker/certs.d" ) diff --git a/docs/registry.go b/docs/registry.go index 9c8666ea..6a0587a2 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -62,7 +62,7 @@ func newTLSConfig(hostname string, isSecure bool) (*tls.Config, error) { tlsConfig.InsecureSkipVerify = !isSecure - if isSecure { + if isSecure && CertsDir != "" { hostDir := filepath.Join(CertsDir, cleanPath(hostname)) logrus.Debugf("hostDir: %s", hostDir) if err := ReadCertsDirectory(&tlsConfig, hostDir); err != nil {