sysad.mn

A collection of notes, guides, musings through the lenses of a Linux systems administrator

A collection of notes, guides, musings through the lenses of a Linux systems administrator

  • LinkedIn
  • Instagram
  • GitHub
Written with ❤

OpenSSL: Creating RSA Key, Certificate Signing Request (CSR) with Subject Alternative Name (SAN)

14 February, 2018 By gerald Leave a Comment

Handy command to create a .csr and 2048-bit key file

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# openssl req -new -sha256 -nodes -out domain.csr -newkey rsa:2048 -keyout domain.key -config <(
cat <<-EOF
[req]
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
 
[ dn ]
C=AU
ST=New South Wales
L=Sydney
O=Happy Organisation
OU=Creative Services
emailAddress=support@domain.com
CN = domain.com
 
[ req_ext ]
subjectAltName = @alt_names
 
[ alt_names ]
DNS.1 = domain.com
DNS.2 = www.domain.com
DNS.3 = mail.domain.com
EOF
)

 

Share this:

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Skype
  • Print

Related

Tagged With: csr, linux, openssl, tls

Leave a Reply Cancel reply