Note 01: Scripts presented here were created based on this answer at StackOverflow.
Note 02: If you're on Windows, use Git Bash and prepend commands below with MSYS_NO_PATHCONV=1.
./create_root_cert_and_key.sh
To create a wildcard certificate to your server (e.g. *.candre.dev).
./create_certificate_for_domain.sh candre.dev
To create a certificate with no wildcards:
./create_certificate_for_domain.sh www.candre.dev www.candre.dev
Remember to import rootCA.crt into Trusted Root Certification Authorities of your browser. See this link for details.