SSL_PASS="${KFKCFG_SSL_KEY_PASSWORD}"

mkdir -p ${SSL_FOLDER}
mkdir -p ${TMP_FOLDER}

echo "Retrieving certificates & PK..."
aws s3 cp s3://${S3_CERTS_BUCKET}/${BROKER_ID}/cert ${TMP_FOLDER}
aws s3 cp s3://${S3_CERTS_BUCKET}/${BROKER_ID}/cert-issuer ${TMP_FOLDER}
aws s3 cp s3://${S3_CERTS_BUCKET}/${BROKER_ID}/key ${TMP_FOLDER}
aws s3 cp s3://${S3_CERTS_BUCKET}/ca-cert ${TMP_FOLDER}
# create cert full chain
cat ${TMP_FOLDER}/cert ${TMP_FOLDER}/cert-issuer > ${TMP_FOLDER}/cert-chain
