How to create a self-signed SSL certificate? Aug 23, 2018 Do this: $ openssl req -nodes -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj "/CN=mysite.com"