Create Certificate Signing Request (CSR) on Linux

Step 1 - create a config.txt file for the CSR :

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = Illinois
L = Some City
O = Company Name
OU = IT Dept
CN = www.website.com
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = website.com

Step 2 - create the CSR file:

openssl req -new -out certificate.csr -newkey rsa:2048 -nodes -sha256 -keyout certificate.key -config config.txt

Done!

More info here: https://www.siteground.co.uk/kb/how_to_generate_a_csr/

Leave a Reply