jfromaniello / selfsigned

Generate self-signed certificates from node.js
MIT License
237 stars 53 forks source link

openssl equivalency question #45

Open jakobrosenberg opened 3 years ago

jakobrosenberg commented 3 years ago

Hi, how would I accomplish the following using selfsigned

openssl req -x509 -out localhost.crt -keyout localhost.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=localhost' -extensions EXT -config <( \
   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
jfromaniello commented 3 years ago

I am not sure it will support all the parameters but if you check the code this is a tiny wrapper on top of node-forge which is very flexible.. Maybe by inspecting the source you can figure out how to make that.

I've also found a lot of useful information in the node-forge issues in the past.

I hope this help!

jakobrosenberg commented 3 years ago

Thanks for the reply @jfromaniello . I had a look at node-forge before posting, but it was a bit too esoteric for me.

I'm trying to create a self signed certificate for .local domains. Is there an easy approach for doing that with selfsigned?