diff --git a/deploy/sophosxg.sh b/deploy/sophosxg.sh index 2b86ee61..2cce5c01 100644 --- a/deploy/sophosxg.sh +++ b/deploy/sophosxg.sh @@ -162,38 +162,8 @@ sophosxg_deploy() { [ -f "$_import_pkcs12" ] && rm -f "$_import_pkcs12" return 1 fi - - # create post request - _deploy_post_body="$(_mktemp)" - if [ ! -f "$_deploy_post_body" ]; then - _err "Error creating temp file for HTTP POST" - return 1 - fi - - printf '--SOPHOSXGPOST\r\n' >> "$_deploy_post_body" - printf 'Content-Type: application/xml; charset=utf-8\r\n' >> "$_deploy_post_body" - printf 'Content-Disposition: form-data; name="reqxml"\r\n' >> "$_deploy_post_body" - printf '\r\n' >> "$_deploy_post_body" - printf '\r\n' >> "$_deploy_post_body" - printf '%s\r\n%s\r\n' "$Le_Deploy_sophosxg_user" "$Le_Deploy_sophosxg_password" >> "$_deploy_post_body" - printf '' >> "$_deploy_post_body" - - - %s - UploadCertificate - pkcs12 - %s - certificate.p12 - - - ---SOPHOSXGPOST -Content-Type: application/octet-stream -Content-Disposition: form-data; filename="certificate.p12"; name="file" -%s ---SOPHOSXGPOST-- - - # do upload of cert - attempt to "update" and on failure try "add" + + # do upload of cert via HTTP POST - attempt to "update" and on failure try "add" _req_action_success="no" for _req_action in update add; do _info "Uploading certificate: $_req_action"