How to generate a self-signed SSL certificate on Linux - Linux Tutorials - Learn Linux Configuration

SSL is a protocol used to encrypt and authenticate data on networks, typically between a server and a client. The SSL protocol, and its successor, TLS, use asymmetric encryption which is based on two keys: a private and a public one. An SSL certificate provides an encrypted connection and creates an environment of trust, since it certifies the website we are connecting to is effectively what we intend, and no malicious party is trying to impersonate it.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-generate-a-self-signed-ssl-certificate-on-linux

You can generate self signed ssl in a single command

sudo openssl req -new -x509 -days 365 -nodes
-out /etc/ssl/certs/dev .io.crt
-keyout /etc/ssl/private/dev .io.key
-subj “/C=KE/ST=NAIROBI/L=NAIROBI/O=IT/CN=dev .io”