openssl genrsa -out nodejs-ssl.key 2048 openssl req -new -key nodejs-ssl.key -out nodejs-ssl.csr

openssl genrsa -des3 -out nodejs-ssl.orig.key 2048
  Enter pass phrase for server.key:
  Verifying - Enter pass phrase for server.key:

openssl rsa -in nodejs-ssl.orig.key -out nodejs-ssl.key
  Enter pass phrase for server.orig.key:
  writing RSA key

openssl req -new -key nodejs-ssl.key -out nodejs-ssl.csr
  Country Name (2 letter code) [AU]:US
  State or Province Name (full name) [Some-State]:California

openssl x509 -req -days 365 -in nodejs-ssl.csr -signkey nodejs-ssl.key -out nodejs-ssl.crt

openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.orig
openssl rsa -in server.key.orig -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

openssl req \
  -x509 \
  -nodes \
  -days 365 \
  -newkey rsa:1024 \
  -sha1 \
  -subj '/C=US/ST=Utah/L=Orem/' \
  -keyout nodejs-ssl.key \
  -out nodejs-ssl.crt

By AJ ONeal

If you loved this and want more like it, sign up!

Did I make your day?
Buy me a coffeeBuy me a coffee  

(you can learn about the bigger picture I'm working towards on my patreon page )