xutil.dev
Login

Self-Signed Cert Command Generator

Generate openssl commands for creating self-signed SSL certificates for development and testing. Configure SAN (Subject Alternative Names), wildcards, and validity period for local HTTPS setup

Related Categories:Security
Certificate Fields
RSAEC
2048 bit3072 bit4096 bit
30d90d365d730d
Generated Commands
One-liner

Generate private key and self-signed certificate in one command

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes -subj "/CN=localhost"
Step 1: Generate RSA Private Key

Generate a 2048-bit RSA private key

openssl genrsa -out key.pem 2048
Step 2: Generate CSR

Create a Certificate Signing Request

openssl req -new -key key.pem -out csr.pem -subj "/CN=localhost"
Step 3: Self-Sign

Sign the CSR with the private key

openssl x509 -req -in csr.pem -signkey key.pem -out cert.pem -days 365
Verify Certificate

View the generated certificate details

openssl x509 -in cert.pem -text -noout
Verify Key

Check the private key

openssl pkey -in key.pem -check -noout