How to Generate Self-Signed SSL Certificates using OpenSSL

Ideally, SSL certificates are issued by publicly trusted certificate authorities (e.g. Let?s Encrypt, Comodo, Verisign) to provide authentication and encryption on the internet. However, you could obtain an SSL certificate without going through a third-party certificate authority ? this is what is referred to as a self-signed certificate.