Generate Self-Signed SSL Certificate without prompt
✓ Published0🌍 Public
TThanad
Last edited Apr 7, 2015
Created on Jan 1, 2018
This example shows a shell script that automates the creation of self-signed SSL certificates and keys without interactive prompts. It generates a random passphrase using `openssl rand`, creates a private key with `openssl genrsa`, and produces a certificate signing request via `openssl req` with a hardcoded subject. The script strips the passphrase from the key using `openssl rsa`, then signs the certificate with `openssl x509` for a 36500-day validity. The final `server.crt` and `server.key` files are renamed to `ssl.crt` and `ssl.key`.
AI-generated description