This repository contains a script that will generate a trusted ssl certificate which can be used for local software development.
- OpenSSL.
- Bash (Linux only).
- Git Bash (Windows only).
- Clone the project.
- Open a terminal in the root directory.
- Run
./generate.sh
Or, alternatively, copy and paste the next snippet.
git clone https://gist.github.com/a6282b0e7ca579fff0e296227675190d.git generate-trusted-ssl-certificate
cd generate-trusted-ssl-certificate
./generate.sh
You can adjust openssl-custom.cnf
configuration file to whatever you prefer.
# Show the certificate
openssl x509 -in server.crt
# Show as 'human-readable' certificate content
openssl x509 -text -in server.crt
# Show as 'human-readable' certificate content (omitting the base64-printed cert at the end)
openssl x509 -text -noout -in server.crt
# Export certificate and private key pair as a pkcs#12 certificate (PFX)
openssl pkcs12 -export -out cert.pfx -inkey server.key -in server.crt
More example commands in openssl-commands.txt.