    fi
    cat "${BASEDIR}/certs/${domain}/chain-${timestamp}.pem" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
  
-@@ -581,7 +588,7 @@
+@@ -596,7 +603,7 @@
      if [[ -e "${cert}" ]]; then
        printf " + Checking domain name(s) of existing cert..."
  

   res=$?
   set -e
   if [[ ${res} -ne 0 ]]; then
@@ -297,7 +304,7 @@
   protected64="$(printf '%s' "${protected}" | urlbase64)"
 
   # Sign header with nonce and our payload with our private key and encode signature as urlbase64
-  signed64="$(printf '%s' "${protected64}.${payload64}" | openssl dgst -sha256 -sign "${PRIVATE_KEY}" | urlbase64)"
+  signed64="$(printf '%s' "${protected64}.${payload64}" | ${OPENSSL} dgst -sha256 -sign "${PRIVATE_KEY}" | urlbase64)"
 
   # Send header + extended header + payload + signature to the acme-server
   data='{"header": '"${header}"', "protected": "'"${protected64}"'", "payload": "'"${payload64}"'", "signature": "'"${signed64}"'"}'
@@ -310,11 +317,11 @@
 extract_altnames() {
   csr="${1}" # the CSR itself (not a file)
 

         ;;
     esac
 
@@ -477,8 +484,8 @@
 
   # Finally request certificate from the acme-server and store it in cert-${timestamp}.pem and link from cert.pem
   echo " + Requesting certificate..."
