Commit 8d0bab39 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: support CA certs provided as file

parent 6a1bb123
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -157,6 +157,15 @@ variables:
    fi
  }

  function as_content() {
    file_or_content=$1
    if [[ -f "${file_or_content}" ]]; then
      cat "${file_or_content}"
    else
      echo "${file_or_content}"
    fi
  }

  function install_ca_certs() {
    certs=$1
    if [[ -z "$certs" ]]
@@ -185,7 +194,7 @@ variables:
      if [[ -f "${bundle}" ]]
      then
        # Import certificates in bundle
        echo "${certs}" | tr -d '\r' >> "${bundle}"
        as_content "$certs" | tr -d '\r' >> "${bundle}"

        log_info "Custom CA certificates imported in \\e[33;1m${bundle}\\e[0m"
        ca_imported=1