How to easily create self signed SSL certificate for testing purposes?
-
Please use the search, this should have been asked and answered already, if not search the other stackoverflow Q&A sites, too please // close-votes but nobody suggested a duplicate - there ain't one? – hakre Jan 10 '13 at 23:47
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
-
25As a one-liner: openssl req -new -x509 -nodes -out server.crt -keyout server.key – Alex Mar 19 '14 at 20:24
-
1
-
3
-
3For Windows users: Git Bash includes
openssl
. I thick Git is one of must have things in developer's system ^) – kyb Jan 30 '18 at 21:40 -
1For windows, you could find it at "C:\Program Files\Git\usr\bin\openssl.exe" – John_J Oct 12 '20 at 0:48