5
This commit is contained in:
parent
d27ce151c5
commit
a17b7ea9db
8
.gitignore
vendored
8
.gitignore
vendored
@ -18,4 +18,10 @@ yarn-error.log*
|
|||||||
requests.rest
|
requests.rest
|
||||||
.prettierrc
|
.prettierrc
|
||||||
CSV_FILES/
|
CSV_FILES/
|
||||||
log/
|
log/
|
||||||
|
|
||||||
|
|
||||||
|
bin/output/cert.csr
|
||||||
|
bin/output/cert.pem
|
||||||
|
bin/output/priv.key
|
||||||
|
bin/tmp/csrconfig.txt
|
||||||
|
|||||||
@ -1,20 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
STATE=$(head -1 vars/state)
|
STATE=$(head -1 vars/state)
|
||||||
COUNTRY=$(head -1 vars/country)
|
COUNTRY=$(head -1 vars/country)
|
||||||
LOCALITY=$(head -1 vars/locality)
|
LOCALITY=$(head -1 vars/locality)
|
||||||
ORGANIZATION=$(head -1 vars/organization)
|
ORGANIZATION=$(head -1 vars/organization)
|
||||||
LOCALITRY=$(head -1 vars/locality)
|
LOCALITRY=$(head -1 vars/locality)
|
||||||
CN=$(head -1 vars/cn)
|
CN=$(head -1 vars/cn)
|
||||||
|
DAYS=$(head -1 vars/days)
|
||||||
|
|
||||||
SUBJECT_ALTERNATIVES=$( python3 gen-subject-alternatives.py )
|
SUBJECT_ALTERNATIVES=$( python3 gen-subject-alternatives.py )
|
||||||
#sed -e "s/###CN##/commonName = $COMMON_NAME/g" \
|
|
||||||
# -e "s/###COUNTRY###/countryName = $COUNTRY/g" \
|
|
||||||
# -e "s/###STATE###/stateOrProvinceName = $STATE/g" \
|
|
||||||
# -e "s/###LOCALITY###/localityName = $LOCALITY/g" \
|
|
||||||
# -e "s/###ORGANIZATION###/organizationName = $ORGANIZATION/g" \
|
|
||||||
# templates/csrconfig.txt.in
|
|
||||||
|
|
||||||
jinja2 templates/csrconfig.txt.j2 -D cn="${CN}" -D country="${COUNTRY}" -D state="${STATE}" -D locality="${LOCALITY}" \
|
jinja2 templates/csrconfig.txt.j2 -D cn="${CN}" -D country="${COUNTRY}" -D state="${STATE}" -D locality="${LOCALITY}" \
|
||||||
-D org="${ORGANIZATION}" -D subj_alternative="${SUBJECT_ALTERNATIVES}" > tmp/csrconfig.txt
|
-D org="${ORGANIZATION}" -D subj_alternative="${SUBJECT_ALTERNATIVES}" > tmp/csrconfig.txt
|
||||||
@ -25,3 +19,6 @@ openssl genpkey -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out o
|
|||||||
|
|
||||||
#Create the CSR
|
#Create the CSR
|
||||||
openssl req -new -nodes -key output/priv.key -config tmp/csrconfig.txt -out output/cert.csr
|
openssl req -new -nodes -key output/priv.key -config tmp/csrconfig.txt -out output/cert.csr
|
||||||
|
|
||||||
|
# Generate the self-signed certificate
|
||||||
|
openssl x509 -req -days ${DAYS} -in output/cert.csr -signkey output/priv.key -out output/cert.pem
|
||||||
|
|||||||
1
bin/vars/days
Normal file
1
bin/vars/days
Normal file
@ -0,0 +1 @@
|
|||||||
|
3650
|
||||||
Loading…
x
Reference in New Issue
Block a user