After a long search I finally managed to create SSL certificate for my local network.
I used SmallStep.com
Installation:
Install step
wget https://dl.step.sm/gh-release/cli/docs-ca-install/v0.20.0/step-cli_0.20.0_amd64.deb
sudo dpkg -i step-cli_0.20.0_amd64.deb
Install step-ca
wget https://dl.step.sm/gh-release/certificates/docs-ca-install/v0.20.0/step-ca_0.20.0_amd64.deb
sudo dpkg -i step-ca_0.20.0_amd64.deb
Now Initialize a Certificate Authority
step ca init --name "Local CA" --provisioner admin --dns localhost --address ":8443"
you need to enter a password and then you will get a result similar to this:
✔ Root certificate: /home/mhefny/.step/certs/root_ca.crt
✔ Root private key: /home/mhefny/.step/secrets/root_ca_key
✔ Root fingerprint: 1d2817edc4ace09f727babb020ff4e9f54bd1b9251530c687b210e56cf1f5d44
✔ Intermediate certificate: /home/mhefny/.step/certs/intermediate_ca.crt
✔ Intermediate private key: /home/mhefny/.step/secrets/intermediate_ca_key
✔ Database folder: /home/mhefny/.step/db
✔ Default configuration: /home/mhefny/.step/config/defaults.json
✔ Certificate Authority configuration: /home/mhefny/.step/config/ca.json
remember fingerprint and the paths.
Now assume you have a domain called mylocalnetwork.local
lets generate a certificate for it:
step ca certificate --offline mylocalnetwork.local foo.crt foo.key
either use a local DNS or just add the domain name to /etc/hosts so that it can be translated to machine IP.
The ONLY missing thing is to generate the root certificate that is used as Authority Certificate in Google Chrome.
step-ca $(step path)/config/ca.json
and from another terminal run:
step ca root root.crt
Add root.crt to chrome and other browsers you will use to access your website.
Create a website and use foo.crt foo.key as SSL certificates and key respectivly.
on your browser write: https://mylocalnetwork.local
and your are DONE!