Skip to content

Commit

Permalink
Merge pull request #14 from devilbox/release-0.6
Browse files Browse the repository at this point in the history
Release 0.6
  • Loading branch information
cytopia committed Nov 30, 2019
2 parents b53d6d0 + 01f116f commit 7340f9f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ if [ "${USE_DOCKER}" = "1" ]; then
ERROR=1
fi

echo
echo "[INFO] Validating openssl certificate with openssl client"
if ! run "echo | openssl s_client -verify 8 -CAfile ${CA_CRT_PATH} | grep 'Verify return code: 0 (ok)'" "60"; then
ERROR=1
Expand All @@ -233,6 +234,7 @@ else
echo "[INFO] Ensuring OpenSSL server is not running"
run "ps aux | grep openssl | grep s_server | awk '{print \$2}' | xargs kill 2>/dev/null || true"

echo
echo "[INFO] Starting OpenSSL server"
run "openssl s_server -key ${CERT_KEY_PATH} -cert ${CERT_CRT_PATH} -CAfile ${CA_CRT_PATH} -accept ${OPENSSL_PORT} -www >/dev/null &"

Expand Down
5 changes: 3 additions & 2 deletions bin/ca-gen
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ NAME="ca-gen"
# Generate default options
DEF_KEYSIZE=2048
DEF_DAYS=3650
DEF_SIGN_SIGNATURE="sha256"
# Subject default options
DEF_COUNTRY=
DEF_STATE=
Expand All @@ -23,7 +24,7 @@ DEF_VERBOSE=


print_version() {
echo "${NAME} v0.5"
echo "${NAME} v0.6"
}
print_help() {
echo "USAGE: ${NAME} -n CN [-kdcslouev] <keyfile> <crtfile>"
Expand Down Expand Up @@ -246,7 +247,7 @@ cmd="openssl req \
-new \
-x509 \
-nodes \
-sha256 \
-${DEF_SIGN_SIGNATURE} \
-days ${DEF_DAYS} \
-key ${CA_KEY_FILE} \
-subj '${SUBJECT}' \
Expand Down
8 changes: 5 additions & 3 deletions bin/cert-gen
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ NAME="cert-gen"

# Generate default options
DEF_KEYSIZE=2048
DEF_DAYS=3650
DEF_DAYS=825
DEF_SIGN_SIGNATURE="sha256"
# Subject default options
DEF_COUNTRY=
DEF_STATE=
Expand All @@ -27,7 +28,7 @@ DEF_VERBOSE=


print_version() {
echo "${NAME} v0.5"
echo "${NAME} v0.6"
}
print_help() {
echo "USAGE: ${NAME} -n CN [-kdcsloueav] <ca-key> <ca-crt> <key> <csr> <crt>"
Expand Down Expand Up @@ -251,6 +252,7 @@ ENDOFTEXT
# Command
cmd="openssl req \
-newkey rsa:${DEF_KEYSIZE} \
-${DEF_SIGN_SIGNATURE} \
-nodes \
-extensions v3_req \
-config <(echo \"${OPENSSL_CONFIG}\") \
Expand Down Expand Up @@ -284,7 +286,7 @@ fi
# shellcheck disable=SC1117
cmd="openssl x509 \
-req \
-sha256 \
-${DEF_SIGN_SIGNATURE} \
-extensions v3_req \
-extfile <(printf '[ req ]\nreq_extensions = v3_req\n[ v3_req ]\nsubjectAltName=${ALT_NAMES}\n') \
-days ${DEF_DAYS} \
Expand Down

0 comments on commit 7340f9f

Please sign in to comment.