Get the latest tech news
Setting up a trusted, self-signed SSL/TLS certificate authority in Linux
With OpenSSL, it’s pretty easy to generate a simple self-signed TLS certificate. Just run the following command: 1openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes -keyout cert.key -out cert.crt The files that this command generates, cert.key and cert.crt, could be passed to a web server, for example, and it will work fine; that is, all the connections made to that web server will be properly encrypted.
When you visit a website that uses a self-signed TLS certificate, the browser will block your request and tell you that it’s not safe to proceed. (If you have absolutely no idea how SSL/TLS works, you might want to either read this article or watch this video or consult some other source before continuing. The CN=localhost line specifies that we’re using this config file to obtain a certificate for the domain name localhost.
Or read this on Hacker News