Create your own CA and SSL certs - a complete SSL Walkthrough
Navigate to https://slproweb.com/products/Win32OpenSSL.html and download the Win64_OpenSSL_v1.1.0i (or later version)
Unblock the download and run it,
· Trust the publisher
· Welcome to the OpenSSL Setup Wizard
o Press the “Next >“ button
· License Agreement
o Check the “I accept..” checkbox
o Click the “Next >” button
· Select Destination Location
o Accept the Default C:\OpenSSL-Win64
o Click the “Next >” button
· Select Start Menu folder
o Accept the default of OpenSSL
o Click the “Next >” button
· Select Additional Tasks
o Check the “The OpenSSL binaries…” option
o Click the “Next >” button
· Ready to install
o Click the “Install” button
· Installing
o Chug, chug, chug, …
· Completing the OpenSSL Setup Wizard
o Uncheck all donation options
o Click the “Finish” button
Now we open up a console as Local Adminstrator and navigate to C:\OpenSSL-Win64\bin\
Now we issue the following command to generate a private key
Ø Openssl genrsa -des3 -out myMoloroshCA.key 2048
You will be asked for a password. You must remember this.
Now we generate a root certificate
Ø Openssl req -x509 -new -nodes -key myMoloroshCA.key -sha256 -days 1825 -out myMoloroshCA.pem
You will be asked a bunch of questions – and here are my answers:
· Country Name (2 letter code) [AU]:GB
· State or Province Name (full name) [Some-State]:England
· Locality Name (eg, city) []:YOUR_PLACE
· Organization Name (eg, company) [Internet Widgits Pty Ltd]:COMPANY_NAME
· Organizational Unit Name (eg, section) []:Development
· Common Name (e.g. server FQDN or YOUR name) []:MOLOROSH_CA
· Email Address []:[email protected]
Note: The Common Name is the only important one as this is displayed in cert lists.
Now you import the myMoloroshCA.pem into your trusted Root Certificate store. There is no password requested in this process.
Now we generate a private key for the website (we are going with testapp2.com)
Ø openssl genrsa -out testapp2.com.key 2048
Now you will generate a certificate signing request and will be asked for a challenge password. THIS MUST BE DIFFERENT FROM THE ROOT CERTIFICATE PRIVATE KEY as you must share this with the website owner.
openssl req -new -key testapp2.com.key -out testapp2.com.key.csr
These are the supplied organisational details
· Country Name (2 letter code) [AU]:GB
· State or Province Name (full name) [Some-State]:England
· Locality Name (eg, city) []:YOUR_CITY
· Organization Name (eg, company) [Internet Widgits Pty Ltd]:COMPANY Limited
· Organizational Unit Name (eg, section) []:DEVELOPMENT
· Common Name (e.g. server FQDN or YOUR name) []:testapp2.com
· Email Address []:[email protected]
· Please enter the following 'extra' attributes
· to be sent with your certificate request
· A challenge password []:CHALLENGEPASSWORD
· An optional company name []:COMPANY_NAME
Now we need a config file:
So create a new text file called: testapp2.com.ext and populate it with the following
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = testapp2.com
DNS.2 = testapp2.com.127.0.0.1.xip.io
Now you combine many of these files in a command to create the website SSL certificate
Ø openssl x509 -req -in testapp2.com.csr -CA myMoloroshCA.pem -CAkey myMoloroshCA.key -CAcreateserial -out testapp2.com.crt -days 1825 -sha256 -extfile testapp2.com.ext
You will be prompted for your super-secret root CA password here…
And finally you had best also convert the output file (testapp2.com.crt) into a .pfx file so it can be used by IIS.
Ø openssl pkcs12 -export -out testapp2.com.pfx -inkey testapp2.com.key -in testapp2.com.crt -certfile myMoloroshCA.pem
Note: you will be asked for an export password – use the same as the CHALLENGEPASSWORD for consistency.
You can now import the certificate (testapp2.com.pfx) by importing the certificate into the local system/computer account.
The last little bit of secret-sauce is to edit the C:\Windows\System32\drivers\etc\hosts file and add the following line:
127.0.0.1 testapp2.com
Now when you navigate to https://testapp2.com:1234/ you get a valid SSL certificate and service workers will run properly.








