Add IsSecure() to Transport

This commit is contained in:
Wichert Akkerman
2019-10-11 07:15:47 +02:00
committed by Mickaël Rémond
parent 7fa4b06705
commit 8db608ccc1
4 changed files with 21 additions and 6 deletions

View File

@@ -39,7 +39,7 @@ func NewSession(transport Transport, o Config, state SMState) (*Session, error)
return nil, NewConnError(s.err, true)
}
if !s.TlsEnabled && !o.Insecure {
if !transport.IsSecure() && !o.Insecure {
err := fmt.Errorf("failed to negotiate TLS session : %s", s.err)
return nil, NewConnError(err, true)
}