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 2048STEP 2: Create the certificate signing request (CSR)
openssl req -new -key cert.key -out cert.csrSTEP 3: Sign the certificate using the private key and CSR
openssl x509 -req -days 3650 -in cert.csr -signkey cert.key -out cert.crtCongratulations! You now have a self-signed SSL certificate valid for 10 years.