How to Generate a Self Signed Certificate

This is how to generate a strong self signed certificate using one command

openssl req -x509 -nodes -sha256 -newkey rsa:2048 \
        -days 365 \
        -keyout server.key -out server.pem

social