Enable HTTPS on the local docker environment
Install Chocolatey
Source: https://chocolatey.org/install
Run PowerShell
as administrator
Run Get-ExecutionPolicy
. If it returns Restricted
, then run Set-ExecutionPolicy AllSigned
or Set-ExecutionPolicy Bypass -Scope Process
Run the following command to install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install and setup certificates
Source: https://github.com/FiloSottile/mkcert
# search package
$ choco search mkcert
# list installed packages
$ choco list --local-only
# install mkcert package
$ choco install mkcert
# install a local CA (Certificate Authority)
$ mkcert -install
# create a new certificate valid for the following names
$ mkcert "*.tphp.net" "*.trafficdemos.net" "*.futuristic.agency" localhost 127.0.0.1 ::1
Install and use in Linux
# first install `certutil`
sudo apt-get update
sudo apt install libnss3-tools
# goto releases, copy `amd64` release and download
wget -O mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.4/mkcert-v1.4.4-linux-amd64
# make the file executable and place the binary under `/usr/local/bin`
chmod +x mkcert
sudo mv mkcert /usr/local/bin
# install the local CA (Certificate Authority) in the system trust store
mkcert -install
# create a new certificate valid for the following names
mkcert example.com "*.aecb.gov.ae" localhost 127.0.0.1 ::1
# update-ca-certificates is a program that updates the directory /etc/ssl/certs
# to hold SSL certificates and generates ca-certificates
update-ca-certificates