#!/bin/bash # Generate TLS certificates for development # This script creates self-signed certificates for local development only # DO NOT use these certificates in production set -e # Create certs directory if it doesn't exist mkdir -p certs # Change to certs directory cd certs # Generate private key echo "Generating private key..." openssl genrsa -out key.pem 2048 # Generate certificate signing request echo "Generating certificate signing request..." openssl req -new -key key.pem -out cert.csr -subj "/C=US/ST=State/L=City/O=Organization/OU=OrgUnit/CN=localhost" # Generate self-signed certificate echo "Generating self-signed certificate..." openssl x509 -req -days 365 -in cert.csr -signkey key.pem -out cert.pem # Create certificate with Subject Alternative Names for localhost echo "Creating certificate with SAN..." cat > cert.conf <