Skip to content

Commit dd7ab0e

Browse files
committed
registry: deprecate HostCertsDir
This function was only used internally, but it still has at least one external consumer, so adding a "deprecated" comment. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 3cc9881 commit dd7ab0e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

registry/registry.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,25 @@ import (
1818
)
1919

2020
// HostCertsDir returns the config directory for a specific host.
21+
//
22+
// Deprecated: this function was only used internally, and will be removed in a future release.
2123
func HostCertsDir(hostname string) string {
24+
return hostCertsDir(hostname)
25+
}
26+
27+
// hostCertsDir returns the config directory for a specific host.
28+
func hostCertsDir(hostname string) string {
2229
return filepath.Join(CertsDir(), cleanPath(hostname))
2330
}
2431

2532
// newTLSConfig constructs a client TLS configuration based on server defaults
2633
func newTLSConfig(hostname string, isSecure bool) (*tls.Config, error) {
2734
// PreferredServerCipherSuites should have no effect
2835
tlsConfig := tlsconfig.ServerDefault()
29-
3036
tlsConfig.InsecureSkipVerify = !isSecure
3137

3238
if isSecure {
33-
hostDir := HostCertsDir(hostname)
39+
hostDir := hostCertsDir(hostname)
3440
log.G(context.TODO()).Debugf("hostDir: %s", hostDir)
3541
if err := ReadCertsDirectory(tlsConfig, hostDir); err != nil {
3642
return nil, err

0 commit comments

Comments
 (0)