Skip to content

crypto/x509: Certificate.Verify rejects self-signed leaf #58792

Description

@rittneje

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

$ go version
1.19.6 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env

What did you do?

https://go.dev/play/p/tE0FcCY4HfS

In short, the leaf certificate is self-signed. There is an intermediate certificate that has the same subject/key as the leaf that was signed by the root.

We encountered this issue while attempting to upgrade from 1.18 to 1.19. The linked code works correctly in 1.18, but gets rejected with "x509: certificate signed by unknown authority" in 1.19+.

What did you expect to see?

Certificate.Verify should succeed with a chain from leaf to intermediate to root.

What did you see instead?

It rejects the self-signed leaf.

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions