mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-03 11:45:45 +00:00
assume port 443 when not specified in printServerCert() test helper
This commit is contained in:
@@ -663,6 +663,11 @@ func printServerCert(t *testing.T, address string, dnsOverrides map[string]strin
|
||||
host = dnsOverrides[host]
|
||||
}
|
||||
|
||||
if !strings.Contains(host, ":") {
|
||||
// tls.Dial() requires a port number, but there was no port number in the host, so assume 443.
|
||||
host += ":443"
|
||||
}
|
||||
|
||||
conn, err := tls.Dial("tcp", host, conf)
|
||||
require.NoError(t, err)
|
||||
defer func() { _ = conn.Close() }()
|
||||
|
||||
Reference in New Issue
Block a user