Create a self-signed SSL certificate
openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout www.example.com.key -out www.example.com.crt
Create a new CSR
openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
Check that key files match cert & request files:
openssl rsa -noout -modulus -in FILE.key
openssl req -noout -modulus -in FILE.csr
openssl x509 -noout -modulus -in FILE.cer