hostCertsDir returns the config directory for a specific host.
(hostnameAndPort string)
| 22 | |
| 23 | // hostCertsDir returns the config directory for a specific host. |
| 24 | func 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 |
| 35 | func newTLSConfig(ctx context.Context, hostname string, isSecure bool) (*tls.Config, error) { |
no test coverage detected
searching dependent graphs…