How to easily create self signed SSL certificate for testing purposes?
1 Answer
You can do this via openssl:
Install openssl package (if you are using Windows, download binaries here).
Generate private key:
openssl genrsa 2048 > private.pem
Generate the self signed certificate:
openssl req -x509 -days 1000 -new -key private.pem -out public.pem
If needed, create PFX:
openssl pkcs12 -export -in public.pem -inkey private.pem -out mycert.pfx
-
34As a one-liner: openssl req -new -x509 -nodes -out server.crt -keyout server.key– AlexMar 19, 2014 at 20:24
-
2
-
4
-
7For Windows users: Git Bash includes
openssl
. I thick Git is one of must have things in developer's system ^)– kybJan 30, 2018 at 21:40 -
1For windows, you could find it at "C:\Program Files\Git\usr\bin\openssl.exe" Oct 12, 2020 at 0:48