Self Signed Certificates
Generate self signed ssl certificates with your own root CA certificate
This project provides some scripts to setup a root CA to sign single domain or multi-domain (wildcard) certificates.
root_ca.sh
: creates root CA certificatesite.sh
: creates single-domain certificatestar.sh
: creates multi-domain certificate
Requires
- openssl ~= (OpenSSL 1.0.2g 1 Mar 2016)
Howto
root CA
- Edit
[req_distinguished_name]
inroot_ca.ini
to match your needs. Checkman req
for information on fields. - Run
./root_ca.sh
single domain
- Edit
[req_distinguished_name]
insite.ini
to match your needs. Checkman req
for information on fields. - Change domain in
site.ini
. You need to changeCN = <host>
as well as entry insubjectAltName = DNS:<host>
- Run
./site.sh
multi domain (wildcard)
- Edit
[req_distinguished_name]
instar.ini
to match your needs. Checkman req
for information on fields. - Change domain in
star.ini
. You need to changeCN = <host>
as well as entries in[alt_names]
to match your sub-domains. - Run
./star.sh
Testing
- Import
root_ca.crt
in Browser and/or OS:- Chrome : Type in Url "chrome://settings/certificates" > Tab:Authorities > Button:Import > Select
root_ca.crt
> Trust this cert for indent. websites Use "chrome://flags/#show-cert-link" to see certificate details from Url-Pane. - Firefox : Type in Url "about:preferences#privacy" > Section:Certificates > Button:View Certificates > Tab:Authorities > Button:Import... > Select
root_ca.crt
> Trust this cert for indent. websites - macOS : Double click on
root_ca.crt
> Keychain opens > Choose Keychain: System > Button:Add Select in Tab:Keychains System and double-click onAA Certification
cert. Fold:Trust > Change:When using this certificate:Always Trust. - Ubunutu :
sudo cp root_ca.crt /usr/local/share/ca-certificates sudo update-ca-certificates
- Chrome : Type in Url "chrome://settings/certificates" > Tab:Authorities > Button:Import > Select
- Add some entries in your
/etc/hosts
file. E.g.:127.0.0.1 aa.aa 127.0.0.2 one.aa.aa 127.0.0.3 two.test.aa
- Get
node
. - Start HTTPS server with:
node test/https.js site
for single site- Browse https://aa.aa:8443
node test/https.js star
for multi domain- Browse https://aa.aa:8443
- Browse https://one.aa.aa:8443
- Browse https://two.test.aa:8443
- Browse https://localhost:8443
License
- Unlicense https://unlicense.org