Skip to content

crypto/x509: check that private key matches the issuer #37845

Description

@shoobyban

I have checked several examples and couldn't find out why my client certificate was invalid, until @FiloSottile pointed out that I'm trying to sign the cert with its own key.

A check is possible as we pass the public key.

func CreateCertificate(rand io.Reader, template, parent *Certificate, pub, priv interface{}) (cert []byte, err error) {

Behaviour: after successful creation of certificate on connection checks fail with "x509: ECDSA verification failure"

Expected behaviour: CreateCertificate would return an error stating signing with own key will not be a successful tactic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions