161
161
# 2016-12-03 bugfix CSR renewal when no SANS and when using MINGW (1.85)
162
162
# 2016-12-16 create CSR_SUBJECT variable - Issue #193
163
163
# 2016-12-16 added fullchain to archive (1.86)
164
+ # 2016-12-16 updated DOMAIN_PEM_LOCATION when using DUAL_RSA_ECDSA (1.87)
164
165
# ----------------------------------------------------------------------------------------
165
166
166
167
PROGNAME=${0##*/ }
167
- VERSION=" 1.86 "
168
+ VERSION=" 1.87 "
168
169
169
170
# defaults
170
171
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.
356
357
scp $from ${to: 4} "
357
358
fi
358
359
debug " userid $TOKEN_USER_ID "
359
- if [[ ! -z " $TOKEN_USER_ID " ]]; then
360
+ if [[ " $cert " == " challenge token " ]] && [[ ! -z " $TOKEN_USER_ID " ]]; then
360
361
servername=$( echo " $to " | awk -F" :" ' {print $2}' )
361
362
tofile=$( echo " $to " | awk -F" :" ' {print $3}' )
362
363
debug " servername $servername "
@@ -410,7 +411,7 @@ copy_file_to_location() { # copies a file, using scp if required.
410
411
if ! cp -p " $from " " $to " ; then
411
412
error_exit " cannot copy $from to $to "
412
413
fi
413
- if [[ ! -z " $TOKEN_USER_ID " ]]; then
414
+ if [[ " $cert " == " challenge token " ]] && [[ ! -z " $TOKEN_USER_ID " ]]; then
414
415
chown " $TOKEN_USER_ID " " $to "
415
416
fi
416
417
fi
@@ -1868,6 +1869,10 @@ if [[ ! -z "$DOMAIN_CHAIN_LOCATION" ]]; then
1868
1869
fi
1869
1870
cat " $CERT_FILE " " $CA_CERT " > " $TEMP_DIR /${DOMAIN} _chain.pem"
1870
1871
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
1871
1876
fi
1872
1877
# if DOMAIN_KEY_CERT_LOCATION is not blank, then create and copy file.
1873
1878
if [[ ! -z " $DOMAIN_KEY_CERT_LOCATION " ]]; then
@@ -1878,6 +1883,10 @@ if [[ ! -z "$DOMAIN_KEY_CERT_LOCATION" ]]; then
1878
1883
fi
1879
1884
cat " $DOMAIN_DIR /${DOMAIN} .key" " $CERT_FILE " > " $TEMP_DIR /${DOMAIN} _K_C.pem"
1880
1885
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
1881
1890
fi
1882
1891
# if DOMAIN_PEM_LOCATION is not blank, then create and copy file.
1883
1892
if [[ ! -z " $DOMAIN_PEM_LOCATION " ]]; then
@@ -1888,6 +1897,10 @@ if [[ ! -z "$DOMAIN_PEM_LOCATION" ]]; then
1888
1897
fi
1889
1898
cat " $DOMAIN_DIR /${DOMAIN} .key" " $CERT_FILE " " $CA_CERT " > " $TEMP_DIR /${DOMAIN} .pem"
1890
1899
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
1891
1904
fi
1892
1905
# end of copying certs.
1893
1906
0 commit comments