Skip to content

Commit

Permalink
Merge pull request #459 from srvrco/Fix-missing-chain.crt-#349
Browse files Browse the repository at this point in the history
Fix missing chain.crt #349
  • Loading branch information
timkimber authored Nov 23, 2019
2 parents 6e8d4ec + 9248ce7 commit 5aa3304
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion getssl
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,9 @@ get_certificate() { # get certificate for csr, if all domains validated.
cd=$(curl --user-agent "$CURL_USERAGENT" --silent "$OrderLink")
CertData=$(json_get "$cd" "certificate")
debug "CertData is at $CertData"
curl --user-agent "$CURL_USERAGENT" --silent "$CertData" > "$CERT_FILE"
curl --user-agent "$CURL_USERAGENT" --silent "$CertData" > "$FULL_CHAIN"
info "Full certificate saved in $FULL_CHAIN"
awk -v CERT_FILE="$CERT_FILE" -v CA_CERT="$CA_CERT" 'BEGIN {outfile=CERT_FILE} split_after==1 {outfile=CA_CERT;split_after=0} /-----END CERTIFICATE-----/ {split_after=1} {print > outfile}' "$FULL_CHAIN"
info "Certificate saved in $CERT_FILE"
fi
}
Expand Down Expand Up @@ -1761,6 +1763,7 @@ ACCOUNT_KEY="${ACCOUNT_KEY:=$WORKING_DIR/account.key}"
DOMAIN_STORAGE="${DOMAIN_STORAGE:=$WORKING_DIR}"
DOMAIN_DIR="$DOMAIN_STORAGE/$DOMAIN"
CERT_FILE="$DOMAIN_DIR/${DOMAIN}.crt"
FULL_CHAIN="$DOMAIN_DIR/fullchain.crt"
CA_CERT="$DOMAIN_DIR/chain.crt"
TEMP_DIR="$DOMAIN_DIR/tmp"
if [[ "$os" == "mingw" ]]; then
Expand Down

0 comments on commit 5aa3304

Please sign in to comment.