Generation of a self-signed SSL certificate involves a simple 3-step procedure:
STEP 1: Create the server private key
openssl genrsa -out cert.key 2048
STEP 2: Create the certificate signing request (CSR)
openssl req -new -key cert.key -out cert.csr