Skip to content

crypto/tls: wrap handshake errors #48151

@ptagrawal

Description

@ptagrawal

What version of Go are you using (go version)?

$ go version
1.14.12

Does this issue reproduce with the latest release?

Not sure

What operating system and processor architecture are you using (go env)?

Busybox OS, ARM architecture

go env Output
$ go env

What did you do?

We are trying to print the certs in the event when the cert based handshake fails.

What did you expect to see?

In the event of invalid certs being provided to establish a connection the tls handshake should fail, and trying to print the bad certificate using errors.As should log the certificate.

What did you see instead?

From the code it looks like its done wrong for client certs.
chains, err := certs[0].Verify(opts)
if err != nil {
c.sendAlert(alertBadCertificate)
return errors.New("tls: failed to verify client certificate: " + err.Error())
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions