How to generate self-signed certificates to be accepted by Chrome and Firefox

Stay secured!

Generate private key

openssl genrsa -out ca.key 2048

Generate root certificate authority

openssl req -x509 -new -nodes -key ca.key -sha256 -days 1825 -out root-ca.pem
openssl genrsa -out github.com.key 2048
openssl req -new -key github.com.key -out github.com.csr
nano github.com.ext
openssl x509 -req -in github.com.csr -CA root-ca.pem -CAkey ca.key -CAcreateserial -out github.com.cert -days 1825 -sha256 -extfile github.com.ext
nano github.com.ext

👋