Generate CSR for LightBeam
Step-by-Step Guide
#!/bin/bash
# Define filenames
PRIVATE_KEY="private.key"
CSR="request.csr"
CONFIG_FILE="openssl.cnf"
# Create OpenSSL configuration file
cat > $CONFIG_FILE <<EOL
[ req ]
default_bits = 2048
default_md = sha256
prompt = no
default_keyfile = $PRIVATE_KEY
distinguished_name = req_distinguished_name
req_extensions = req_ext
[ req_distinguished_name ]
C = US
ST = California
L = San Francisco
O = My Organization
OU = My Organizational Unit
CN = [email protected]
emailAddress = [email protected]
[ req_ext ]
subjectAltName = @alt_names
[ alt_names ]
email.1 = [email protected]
EOL
# Generate private key
echo "Generating private key..."
openssl genpkey -algorithm RSA -out $PRIVATE_KEY -aes256
# Generate CSR
echo "Generating CSR..."
openssl req -new -key $PRIVATE_KEY -out $CSR -config $CONFIG_FILE
echo "Private key and CSR have been generated."Usage
Configuration File Sections:
Last updated