File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ if [ "${USE_DOCKER}" = "1" ]; then
212212 ERROR=1
213213 fi
214214
215+ echo
215216 echo " [INFO] Validating openssl certificate with openssl client"
216217 if ! run " echo | openssl s_client -verify 8 -CAfile ${CA_CRT_PATH} | grep 'Verify return code: 0 (ok)'" " 60" ; then
217218 ERROR=1
233234 echo " [INFO] Ensuring OpenSSL server is not running"
234235 run " ps aux | grep openssl | grep s_server | awk '{print \$ 2}' | xargs kill 2>/dev/null || true"
235236
237+ echo
236238 echo " [INFO] Starting OpenSSL server"
237239 run " openssl s_server -key ${CERT_KEY_PATH} -cert ${CERT_CRT_PATH} -CAfile ${CA_CRT_PATH} -accept ${OPENSSL_PORT} -www >/dev/null &"
238240
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ NAME="ca-gen"
99# Generate default options
1010DEF_KEYSIZE=2048
1111DEF_DAYS=3650
12+ DEF_SIGN_SIGNATURE=" sha256"
1213# Subject default options
1314DEF_COUNTRY=
1415DEF_STATE=
@@ -23,7 +24,7 @@ DEF_VERBOSE=
2324
2425
2526print_version () {
26- echo " ${NAME} v0.5 "
27+ echo " ${NAME} v0.6 "
2728}
2829print_help () {
2930 echo " USAGE: ${NAME} -n CN [-kdcslouev] <keyfile> <crtfile>"
@@ -246,7 +247,7 @@ cmd="openssl req \
246247 -new \
247248 -x509 \
248249 -nodes \
249- -sha256 \
250+ -${DEF_SIGN_SIGNATURE} \
250251 -days ${DEF_DAYS} \
251252 -key ${CA_KEY_FILE} \
252253 -subj '${SUBJECT} ' \
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ NAME="cert-gen"
88
99# Generate default options
1010DEF_KEYSIZE=2048
11- DEF_DAYS=3650
11+ DEF_DAYS=825
12+ DEF_SIGN_SIGNATURE=" sha256"
1213# Subject default options
1314DEF_COUNTRY=
1415DEF_STATE=
@@ -27,7 +28,7 @@ DEF_VERBOSE=
2728
2829
2930print_version () {
30- echo " ${NAME} v0.5 "
31+ echo " ${NAME} v0.6 "
3132}
3233print_help () {
3334 echo " USAGE: ${NAME} -n CN [-kdcsloueav] <ca-key> <ca-crt> <key> <csr> <crt>"
@@ -251,6 +252,7 @@ ENDOFTEXT
251252# Command
252253cmd=" openssl req \
253254 -newkey rsa:${DEF_KEYSIZE} \
255+ -${DEF_SIGN_SIGNATURE} \
254256 -nodes \
255257 -extensions v3_req \
256258 -config <(echo \" ${OPENSSL_CONFIG} \" ) \
284286# shellcheck disable=SC1117
285287cmd=" openssl x509 \
286288 -req \
287- -sha256 \
289+ -${DEF_SIGN_SIGNATURE} \
288290 -extensions v3_req \
289291 -extfile <(printf '[ req ]\nreq_extensions = v3_req\n[ v3_req ]\nsubjectAltName=${ALT_NAMES} \n') \
290292 -days ${DEF_DAYS} \
You can’t perform that action at this time.
0 commit comments