File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ EXIT_CODE=0
2323CA_KEY=" "
2424CA=" "
2525CA_ONLY=" "
26+ CA_EXT=" "
2627TRUST=" "
2728SUBJ=" "
2829
@@ -141,6 +142,7 @@ _help() {
141142 --ca-key Path to certificate authority key file
142143 (Generates new CA if not set)
143144 --ca-only Instructs script to solely generate a certificate authority
145+ --ca-ext Allow passing extensions to the CA request
144146 -t|--trust Flag to trust certificate authority
145147 (Do not set for default 'false')
146148
@@ -205,6 +207,7 @@ _parse_args() {
205207 --ca|--ca-cert) CA=" ${VALUE} " ;;
206208 --ca-key) CA_KEY=" ${VALUE} " ;;
207209 --ca-only) CA_ONLY=1;;
210+ --ca-ext) CA_EXT=" ${VALUE} " ;;
208211 -t|--trust) TRUST=1;;
209212 # CSR
210213 --csr) CSR=" ${VALUE} " ;;
@@ -457,9 +460,15 @@ _build_ca() {
457460 return
458461 fi
459462
463+ EXT=" "
464+ if [ -n " ${CA_EXT} " ]; then
465+ EXT=" -extensions ${CA_EXT} "
466+ fi
467+
460468 # Generate certificate authority files
461469 openssl genrsa -out " ${CA_KEY} " " ${BITS} "
462470 openssl req -new -nodes -x509 -sha256 \
471+ $( printf " %s" " ${EXT} " ) \
463472 -subj " ${SUBJ} " \
464473 -days " ${DAYS} " \
465474 -key " ${CA_KEY} " \
You can’t perform that action at this time.
0 commit comments