MCPcopy Create free account
hub / github.com/docker/cli / hostCertsDir

Function hostCertsDir

internal/registry/registry.go:24–32  ·  view source on GitHub ↗

hostCertsDir returns the config directory for a specific host.

(hostnameAndPort string)

Source from the content-addressed store, hash-verified

22
23// hostCertsDir returns the config directory for a specific host.
24func hostCertsDir(hostnameAndPort string) string {
25 if runtime.GOOS == "windows" {
26 // Ensure that a directory name is valid; hostnameAndPort may contain
27 // a colon (:) if a port is included, and Windows does not allow colons
28 // in directory names.
29 hostnameAndPort = filepath.FromSlash(strings.ReplaceAll(hostnameAndPort, ":", ""))
30 }
31 return filepath.Join(CertsDir(), hostnameAndPort)
32}
33
34// newTLSConfig constructs a client TLS configuration based on server defaults
35func newTLSConfig(ctx context.Context, hostname string, isSecure bool) (*tls.Config, error) {

Callers 1

newTLSConfigFunction · 0.85

Calls 1

CertsDirFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…