From bc42b563bfbde739b33744a08737b55e2ada9544 Mon Sep 17 00:00:00 2001 From: m00nh34d Date: Tue, 2 Jan 2018 17:44:30 +1100 Subject: [PATCH] Include CA Bundle in API call Added in the cabundle parameter and included the CA in it, for situations where the Let's Encrypt root CA isn't on the system. --- deploy/cpanel_uapi.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deploy/cpanel_uapi.sh b/deploy/cpanel_uapi.sh index 4563b9c4..43003692 100644 --- a/deploy/cpanel_uapi.sh +++ b/deploy/cpanel_uapi.sh @@ -35,11 +35,14 @@ cpanel_uapi_deploy() { # read cert and key files and urlencode both _certstr=$(cat "$_ccert") _keystr=$(cat "$_ckey") + _castr=$(cat "$_cca") _cert=$(php -r "echo urlencode(\"$_certstr\");") _key=$(php -r "echo urlencode(\"$_keystr\");") + _ca=$(php -r "echo urlencode(\"$_castr\");") _debug _cert "$_cert" _debug _key "$_key" + _debug _ca "$_ca" if [ "$(id -u)" = 0 ]; then if [ -z "$DEPLOY_CPANEL_USER" ]; then @@ -47,9 +50,9 @@ cpanel_uapi_deploy() { return 1 fi _savedomainconf DEPLOY_CPANEL_USER "$DEPLOY_CPANEL_USER" - _response=$(uapi --user="$DEPLOY_CPANEL_USER" SSL install_ssl domain="$_cdomain" cert="$_cert" key="$_key") + _response=$(uapi --user="$DEPLOY_CPANEL_USER" SSL install_ssl domain="$_cdomain" cert="$_cert" key="$_key" cabundle="$_ca") else - _response=$(uapi SSL install_ssl domain="$_cdomain" cert="$_cert" key="$_key") + _response=$(uapi SSL install_ssl domain="$_cdomain" cert="$_cert" key="$_key" cabundle="$_ca") fi error_response="status: 0" if test "${_response#*$error_response}" != "$_response"; then