Skip to content

Commit 51f59b5

Browse files
author
srvrco
committed
issue #231 mingw bugfix and typos in debug messages
1 parent df3285d commit 51f59b5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

getssl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@
179179
# 2017-01-12 added drill, dig or host as alternatives to nslookup (2.04)
180180
# 2017-01-18 bugfix issue #227 - error deleting csr if doesn't exist
181181
# 2017-01-18 issue #228 check private key and account key are different (2.05)
182+
# 2017-01-21 issue #231 mingw bugfix and typos in debug messages (2.06)
182183
# ----------------------------------------------------------------------------------------
183184

184185
PROGNAME=${0##*/}
185-
VERSION="2.05"
186+
VERSION="2.06"
186187

187188
# defaults
188189
ACCOUNT_KEY_LENGTH=4096
@@ -618,13 +619,13 @@ create_key() { # create a domain key (if it doesn't already exist)
618619
key_type=$1 # domain key type
619620
key_loc=$2 # domain key location
620621
key_len=$3 # domain key length - for rsa keys.
621-
# check if domain key exists, if not then create it.
622+
# check if key exists, if not then create it.
622623
if [[ -s "$key_loc" ]]; then
623624
debug "domain key exists at $key_loc - skipping generation"
624625
# ideally need to check validity of domain key
625626
else
626627
umask 077
627-
info "creating domain key - $key_loc"
628+
info "creating key - $key_loc"
628629
case "$key_type" in
629630
rsa)
630631
openssl genrsa "$key_len" > "$key_loc";;
@@ -843,7 +844,7 @@ get_os() { # function to get the current Operating System
843844
os="mac"
844845
elif [[ ${uname_res:0:6} == "CYGWIN" ]]; then
845846
os="cygwin"
846-
elif [[ ${uname_res:0:6} == "MINGW" ]]; then
847+
elif [[ ${uname_res:0:5} == "MINGW" ]]; then
847848
os="mingw"
848849
else
849850
os="unknown"
@@ -1417,6 +1418,11 @@ done
14171418
# Get the current OS, so the correct functions can be used for that OS. (sets the variable os)
14181419
get_os
14191420

1421+
# check if "recent" version of bash.
1422+
#if [[ "${BASH_VERSINFO[0]}${BASH_VERSINFO[1]}" -lt 42 ]]; then
1423+
# info "this script is designed for bash v4.2 or later - earlier version may give errors"
1424+
#fi
1425+
14201426
#check if required applications are included
14211427

14221428
requires which
@@ -1480,6 +1486,9 @@ DOMAIN_DIR="$DOMAIN_STORAGE/$DOMAIN"
14801486
CERT_FILE="$DOMAIN_DIR/${DOMAIN}.crt"
14811487
CA_CERT="$DOMAIN_DIR/chain.crt"
14821488
TEMP_DIR="$DOMAIN_DIR/tmp"
1489+
if [[ "$os" == "mingw" ]]; then
1490+
CSR_SUBJECT="//"
1491+
fi
14831492

14841493
# Set the OPENSSL_CONF environment variable so openssl knows which config to use
14851494
export OPENSSL_CONF=$SSLCONF

0 commit comments

Comments
 (0)