Rename InsecureTrustAlways to InsecureSkipTrust

This commit is contained in:
Adnan Maolood 2020-10-31 23:41:30 -04:00
parent 79b3b22e69
commit 0d3230a7d5

View File

@ -27,11 +27,11 @@ type Client struct {
// A Timeout of zero means no timeout. // A Timeout of zero means no timeout.
Timeout time.Duration Timeout time.Duration
// InsecureTrustAlways specifies whether the client should trust // InsecureSkipTrust specifies whether the client should trust
// any certificate it receives without checking KnownHosts // any certificate it receives without checking KnownHosts
// or calling TrustCertificate. // or calling TrustCertificate.
// Use with caution. // Use with caution.
InsecureTrustAlways bool InsecureSkipTrust bool
// GetInput is called to retrieve input when the server requests it. // GetInput is called to retrieve input when the server requests it.
// If GetInput is nil or returns false, no input will be sent and // If GetInput is nil or returns false, no input will be sent and
@ -208,7 +208,7 @@ func (c *Client) verifyConnection(req *Request, cs tls.ConnectionState) error {
if err := verifyHostname(cert, hostname); err != nil { if err := verifyHostname(cert, hostname); err != nil {
return err return err
} }
if c.InsecureTrustAlways { if c.InsecureSkipTrust {
return nil return nil
} }
// Check the known hosts // Check the known hosts