Dexus / pem

Create private keys and certificates with node.js
Other
572 stars 129 forks source link

"serviceCertificate" option is missing from documentation #243

Closed flarn2006 closed 2 years ago

flarn2006 commented 5 years ago

I spent a lot of time at work tracking down an issue where certificates were being generated with the wrong public key, not the one given in the CSR. After some intense debugging, replacing the OpenSSL binary with a script that logs stuff, etc - I determined that it was using the -signkey option, which (as you know) is for self-signed certificates, and OpenSSL was silently replacing the CSR key with the key I was using as the CA key when generating the certificate.

I searched the library's code for -signkey, and soon discovered that it used that option when the serviceCertificate option was missing from the call to createCertificate. Earlier I had been looking for the option to specify the CA certificate, but couldn't find it. Despite the importance of this option, it's missing from the documentation, save for a brief mention in the description for the -serial option.

https://www.deineagentur.com/projects/pem/module-pem.html#.createCertificate

Dexus commented 2 years ago

The docs should be fixed.