Skip to content

Feature request: better crypto error messages #5444

Closed
@mscdex

Description

@mscdex
  • Version: master
  • Platform: N/A
  • Subsystem: crypto

I noticed today when working with public keys and verifying signatures that I would get generic error messages when there was a problem reading a public key, for example: PEM_read_bio_PUBKEY failed

Whereas if I check the OpenSSL error stack, I find more detailed/useful error strings, for example:

error:10067066:elliptic curve routines:ec_GFp_simple_oct2point:invalid encoding
error:10098010:elliptic curve routines:o2i_ECPublicKey:EC lib
error:100D708E:elliptic curve routines:ECKEY_PUB_DECODE:decode error
error:0B07707D:x509 certificate routines:X509_PUBKEY_get:public key decode error
error:0906700D:PEM routines:PEM_ASN1_read_bio:ASN1 lib

(The first being the most useful probably)

It would be great to have at least the first error message instead of the more generic one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.cryptoIssues and PRs related to the crypto subsystem.feature requestIssues that request new features to be added to Node.js.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions