Unsigned OpenSSL certificates silently

You are having trouble with this - a few other related posts there, but nothing special. I am trying to quietly generate certificates for a dev machine. These are the commands that I initially ran, but they offered me a passphrase:

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

The first command below works, but the second does not work. I see the passin parameter, but I am having problems since I am still being asked for a passphrase.

 openssl genrsa -des3 -passout pass:$passphrase -out server.key 1024 openssl req -passout pass:$passphrase -new -key server.key -out server.csr openssl x509 -req -days 1024 -in server.csr -signkey server.key -out server.crt 
+2
ubuntu openssl
Jan 17 '12 at 20:36
source share
2 answers
 $ openssl genrsa -out server.key 1024 $ touch openssl.cnf $ cat >> openssl.cnf <<EOF [ req ] prompt = no distinguished_name = req_distinguished_name [ req_distinguished_name ] C = GB ST = Test State L = Test Locality O = Org Name OU = Org Unit Name CN = Common Name emailAddress = test@email.com EOF $ openssl req -config openssl.cnf -new -key server.key -out server.csr $ openssl x509 -req -days 1024 -in server.csr -signkey server.key -out server.crt 
+13
Jan 17 2018-12-12T00:
source share

Solution for Windows. Create a batch file (start-https-server.bat) with the following:

 @echo off if not exist ".\openssl.cnf" ( @echo [ req ] > openssl.cnf @echo prompt = no >> openssl.cnf @echo distinguished_name = req_distinguished_name >> openssl.cnf @echo [ req_distinguished_name ] >> openssl.cnf @echo C = IE >> openssl.cnf @echo ST = Test State >> openssl.cnf @echo L = Test Locality >> openssl.cnf @echo O = Org Name >> openssl.cnf @echo OU = Org Unit Name >> openssl.cnf @echo CN = Common Name >> openssl.cnf @echo emailAddress = test@email.com >> openssl.cnf openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem -config openssl.cnf openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out cert.pem ) 

Add the following to the end of the batch file to open the site using node http-server ( https://www.npmjs.com/package/http-server ).

 http-server -S -o 

Caution: this is for development use only.

0
Nov 24 '16 at 18:15
source share



All Articles