-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-config.sh
executable file
·40 lines (36 loc) · 1.2 KB
/
test-config.sh
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
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
BASE=$(realpath $(dirname $0))
cd ${BASE}
CERT=$1
shift
CONFIG="${BASE}/config/server-cert.conf"
cat >$CONFIG <<EOT
[ req ]
default_bits = 2048
default_keyfile = server.key
distinguished_name = req_distinguished_name
string_mask = nombstr
req_extensions = v3_req
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = DK
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Denmark
localityName = Locality Name (eg, city)
localityName_default = Copenhagen
0.organizationName = Organization Name (eg, company)
0.organizationName_default = Trader Internet
organizationalUnitName = Organizational Unit Name (eg, section)
organizationalUnitName_default = Secure Server
commonName = Common Name (eg, www.domain.com)
commonName_default = $CERT
commonName_max = 64
emailAddress = Email Address
emailAddress_default = [email protected]
emailAddress_max = 40
[ v3_req ]
nsCertType = server
basicConstraints = critical,CA:false
EOT