Skip to content

Commit

Permalink
Check errors in download TSL.
Browse files Browse the repository at this point in the history
  • Loading branch information
amusarra committed Sep 20, 2024
1 parent cca9c8e commit 2defa53
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/shell/certs-manager/download_tsl_it_certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ generate_fake_ca() {
print_msg "${GREEN}" "✅ Generated fake CA certificate at ${fake_ca_cert_path}"

# Add the fake CA certificate to the PEM bundle
cat "${fake_ca_cert_path}" >> "${OUTPUT_PATH_PEM_BUNDLE}/${OUTPUT_PEM_BUNDLE_FILE_NAME}"
cat "${fake_ca_cert_path}" >>"${OUTPUT_PATH_PEM_BUNDLE}/${OUTPUT_PEM_BUNDLE_FILE_NAME}"
print_msg "${GREEN}" "✅ Added fake CA certificate to PEM bundle"
}

Expand Down Expand Up @@ -262,7 +262,7 @@ done

# Main function
main() {
print_msg "${YELLOW}" "🚀 Starting the TSL-IT certificate update process"
print_msg "${YELLOW}" "🚀 Starting the TSL-IT certificate update process..."

# Check if the PEM bundle file already exists
if [ -f "${OUTPUT_PATH_PEM_BUNDLE}/${OUTPUT_PEM_BUNDLE_FILE_NAME}" ]; then
Expand All @@ -284,7 +284,13 @@ main() {

local xml_content
xml_content=$(curl --progress-bar -s "${CERTS_URL}")
print_msg "${GREEN}" "✅ Downloaded XML content"
if [ -z "${xml_content}" ]; then
print_msg "${RED}" "❌ Error downloading XML content from ${CERTS_URL}"
exit 1
else
print_msg "${GREEN}" "✅ Downloaded XML content from ${CERTS_URL}"
fi

save_xml_to_file "${xml_content}"
parse_and_save_certs
create_pem_bundle
Expand Down

0 comments on commit 2defa53

Please sign in to comment.