Skip to content

Instantly share code, notes, and snippets.

@lnthien97
Created March 25, 2024 04:21
Show Gist options
  • Save lnthien97/4b8371eca70d98a8014564c058654078 to your computer and use it in GitHub Desktop.
Save lnthien97/4b8371eca70d98a8014564c058654078 to your computer and use it in GitHub Desktop.
Manually Generate a Certificate Signing Request (CSR) Using OpenSSL
# CSR for single domain: abc.example.com
openssl req -new -newkey rsa:2048 \
-keyout abc.key \
-nodes -out abc.csr \
-subj "/C=VN/ST=Ho Chi Minh/L=District 16/O=MyCompany/OU=MyTeam/CN=abc.example.com"
# CSR for multi-domain - Subject Alternative Name (SAN): abc.example.com and xyz.example.com
openssl req -new -newkey rsa:2048 \
-keyout abcxyz.key \
-nodes -out abcxyz.csr \
-subj "/C=VN/ST=Ho Chi Minh/L=District 16/O=MyCompany/OU=MyTeam/CN=abc.example.com" \
-addext "subjectAltName = DNS:abc.example.com, DNS:xyz.example.com"
# CSR for a Wildcard SSL Certificate: *.abc.example.com (including abc.example.com)
openssl req -new -newkey rsa:2048 \
-keyout start.abc.key \
-nodes -out star.abc.csr \
-subj "/C=VN/ST=Ho Chi Minh/L=District 16/O=MyCompany/OU=MyTeam/CN=*.abc.example.com" \
-addext "subjectAltName = DNS:abc.example.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment