Create Self-Signed SSL Certificate in Windows

Download Full version EXE (64 bit) from OpenSSL Installer for Windows.

Install files at C:\Program Files\OpenSSL

Change OPENSSL_CONF variable in ENV Path.

Goto C:\Program Files\OpenSSL\bin

Create file domains.ext enter this codes. change/add your domains.

authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = localhost
DNS.2 = foo.local
DNS.3 = bar.test

Create file makecert.bat enter below codes:

cd "C:\Program Files\OpenSSL\bin"

openssl req -x509 -nodes -new -sha256 -days 1024 -newkey rsa:2048 -keyout RootCA.key -out RootCA.pem -subj "/C=US/CN=Example-Root-CA"
openssl x509 -outform pem -in RootCA.pem -out RootCA.crt

openssl req -new -nodes -newkey rsa:2048 -keyout localhost.key -out localhost.csr -subj "/C=US/ST=YourState/L=YourCity/O=Example-Certificates/CN=localhost.local"
openssl x509 -req -sha256 -days 1024 -in localhost.csr -CA RootCA.pem -CAkey RootCA.key -CAcreateserial -extfile domains.ext -out localhost.crt

certutil -addstore -f -enterprise -user root "RootCA.crt"

PAUSE

Run makecert.bat as Admin then restart Chrome.

Source: https://gist.github.com/cecilemuller/9492b848eb8fe46d462abeb26656c4f8

Share your thoughts by leaving a comment below.