Generate a Self-Signed SSL Certificate With OpenSSL
This is a simple way of creating a self-signed SSL certificate for testing with openssl.
- Create the self-signed SSL certificate request and key:
openssl req -sha512 -newkey rsa:4096 -keyout ssl.example.com.key -out ssl.example.com.crt -days 365 -nodes
- Then create the new self-signed certificate:
openssl x509 -signkey ssl.example.com.key -in ssl.example.com.crt -req -days 365 -out ssl.example.com.crt