Skip to content

Commit 4a701c3

Browse files
author
srvrco
committed
updated DOMAIN_PEM_LOCATION when using DUAL_RSA_ECDSA #190
1 parent 196bd2c commit 4a701c3

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

getssl

+16-3
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@
161161
# 2016-12-03 bugfix CSR renewal when no SANS and when using MINGW (1.85)
162162
# 2016-12-16 create CSR_SUBJECT variable - Issue #193
163163
# 2016-12-16 added fullchain to archive (1.86)
164+
# 2016-12-16 updated DOMAIN_PEM_LOCATION when using DUAL_RSA_ECDSA (1.87)
164165
# ----------------------------------------------------------------------------------------
165166

166167
PROGNAME=${0##*/}
167-
VERSION="1.86"
168+
VERSION="1.87"
168169

169170
# defaults
170171
CODE_LOCATION="https://raw.githubusercontent.com/srvrco/getssl/master/getssl"
@@ -356,7 +357,7 @@ copy_file_to_location() { # copies a file, using scp if required.
356357
scp $from ${to:4}"
357358
fi
358359
debug "userid $TOKEN_USER_ID"
359-
if [[ ! -z "$TOKEN_USER_ID" ]]; then
360+
if [[ "$cert" == "challenge token" ]] && [[ ! -z "$TOKEN_USER_ID" ]]; then
360361
servername=$(echo "$to" | awk -F":" '{print $2}')
361362
tofile=$(echo "$to" | awk -F":" '{print $3}')
362363
debug "servername $servername"
@@ -410,7 +411,7 @@ copy_file_to_location() { # copies a file, using scp if required.
410411
if ! cp -p "$from" "$to" ; then
411412
error_exit "cannot copy $from to $to"
412413
fi
413-
if [[ ! -z "$TOKEN_USER_ID" ]]; then
414+
if [[ "$cert" == "challenge token" ]] && [[ ! -z "$TOKEN_USER_ID" ]]; then
414415
chown "$TOKEN_USER_ID" "$to"
415416
fi
416417
fi
@@ -1868,6 +1869,10 @@ if [[ ! -z "$DOMAIN_CHAIN_LOCATION" ]]; then
18681869
fi
18691870
cat "$CERT_FILE" "$CA_CERT" > "$TEMP_DIR/${DOMAIN}_chain.pem"
18701871
copy_file_to_location "full chain" "$TEMP_DIR/${DOMAIN}_chain.pem" "$to_location"
1872+
if [[ "$DUAL_RSA_ECDSA" == "true" ]]; then
1873+
cat "${CERT_FILE::-4}.ec.crt" "${CA_CERT::-4}.ec.crt" > "$TEMP_DIR/${DOMAIN}_chain.pem.ec"
1874+
copy_file_to_location "full chain" "$TEMP_DIR/${DOMAIN}_chain.pem.ec" "${to_location}.ec"
1875+
fi
18711876
fi
18721877
# if DOMAIN_KEY_CERT_LOCATION is not blank, then create and copy file.
18731878
if [[ ! -z "$DOMAIN_KEY_CERT_LOCATION" ]]; then
@@ -1878,6 +1883,10 @@ if [[ ! -z "$DOMAIN_KEY_CERT_LOCATION" ]]; then
18781883
fi
18791884
cat "$DOMAIN_DIR/${DOMAIN}.key" "$CERT_FILE" > "$TEMP_DIR/${DOMAIN}_K_C.pem"
18801885
copy_file_to_location "private key and domain cert pem" "$TEMP_DIR/${DOMAIN}_K_C.pem" "$to_location"
1886+
if [[ "$DUAL_RSA_ECDSA" == "true" ]]; then
1887+
cat "$DOMAIN_DIR/${DOMAIN}.ec.key" "${CERT_FILE::-4}.ec.crt" > "$TEMP_DIR/${DOMAIN}_K_C.pem.ec"
1888+
copy_file_to_location "private ec key and domain cert pem" "$TEMP_DIR/${DOMAIN}_K_C.pem.ec" "${to_location}.ec"
1889+
fi
18811890
fi
18821891
# if DOMAIN_PEM_LOCATION is not blank, then create and copy file.
18831892
if [[ ! -z "$DOMAIN_PEM_LOCATION" ]]; then
@@ -1888,6 +1897,10 @@ if [[ ! -z "$DOMAIN_PEM_LOCATION" ]]; then
18881897
fi
18891898
cat "$DOMAIN_DIR/${DOMAIN}.key" "$CERT_FILE" "$CA_CERT" > "$TEMP_DIR/${DOMAIN}.pem"
18901899
copy_file_to_location "full key, cert and chain pem" "$TEMP_DIR/${DOMAIN}.pem" "$to_location"
1900+
if [[ "$DUAL_RSA_ECDSA" == "true" ]]; then
1901+
cat "$DOMAIN_DIR/${DOMAIN}.ec.key" "${CERT_FILE::-4}.ec.crt" "${CA_CERT::-4}.ec.crt" > "$TEMP_DIR/${DOMAIN}.pem.ec"
1902+
copy_file_to_location "full ec key, cert and chain pem" "$TEMP_DIR/${DOMAIN}.pem.ec" "${to_location}.ec"
1903+
fi
18911904
fi
18921905
# end of copying certs.
18931906

0 commit comments

Comments
 (0)