Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSA PRIVATE KEY not found from openssl output #346

Closed
anthonyvercolano opened this issue Sep 29, 2022 · 5 comments
Closed

RSA PRIVATE KEY not found from openssl output #346

anthonyvercolano opened this issue Sep 29, 2022 · 5 comments

Comments

@anthonyvercolano
Copy link

anthonyvercolano commented Sep 29, 2022

Using a nodejs script to create a self signed cert on a windows 11 machine. Have installed openssl 3.0.5

Have:

  certOptions.config = [
    '[req]',
    'req_extensions = v3_req',
    'distinguished_name = req_distinguished_name',
    'x509_extensions = v3_ca',
    '[req_distinguished_name]',
    'commonName = ' + commonName,
    '[v3_req]',
    'basicConstraints = critical, CA:true'
  ].join('\n');

invoked pem.createCertificate(certOptions, function(err,cert) {...})
The err.message is:

RSA PRIVATE KEY not found from openssl output:
---stdout---
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCquk7hP6hpIOv0
: Deleted most of the key so that hopefully this doesn't get tagged as a posted secret.
-----END PRIVATE KEY-----

---stderr---

This works on my mac.
Fails on my windows (and a customers windows box).
Using Node 16.17.0

@Uzlopak
Copy link

Uzlopak commented Dec 5, 2022

Duplicate of #316

@kolserdav
Copy link

The same error with OpenSSL 3.0.7 1 Nov 2022 (Library: OpenSSL 3.0.7 1 Nov 2022)

@tkurki
Copy link

tkurki commented Dec 7, 2022

A potential replacement for self signed cert generation: https://www.npmjs.com/package/devcert

@Uzlopak
Copy link

Uzlopak commented Dec 7, 2022

I replaced pem with self-cert.

@Dexus
Copy link
Owner

Dexus commented Apr 4, 2023

This should now fixed by release of 1.14.7 https://www.npmjs.com/package/pem/v/1.14.7
Thanks to @diegoholiveira and @misi

@Dexus Dexus closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants