Harden contract validation, STARTTLS edge cases, and rule output
This commit is contained in:
parent
a925e4f162
commit
fa212f0fae
9 changed files with 104 additions and 39 deletions
|
|
@ -172,7 +172,7 @@ func probe(ctx context.Context, ep contract.TLSEndpoint, timeout time.Duration)
|
|||
func handshake(conn net.Conn, ep contract.TLSEndpoint, sni string) (*tls.Conn, error) {
|
||||
cfg := &tls.Config{
|
||||
ServerName: sni,
|
||||
InsecureSkipVerify: true,
|
||||
InsecureSkipVerify: true, // #nosec G402 -- intentional: chain verified separately in probe()
|
||||
}
|
||||
|
||||
if ep.STARTTLS == "" {
|
||||
|
|
@ -198,7 +198,7 @@ func handshake(conn net.Conn, ep contract.TLSEndpoint, sni string) (*tls.Conn, e
|
|||
}
|
||||
|
||||
var (
|
||||
errStartTLSNotOffered = errors.New("starttls not advertised by server")
|
||||
errStartTLSNotOffered = errors.New("starttls not advertised by server")
|
||||
errUnsupportedStartTLSProto = errors.New("unsupported starttls protocol")
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue