security/acme-client: fix ecc certs renewal bug

This commit is contained in:
Omar Khalil
2018-07-28 15:31:17 +02:00
parent 8d78c1e0e0
commit a792af6259
@@ -799,7 +799,13 @@ function run_acme_validation($certObj, $valObj, $acctObj)
// Get the chosen key length from xml and trim the parameter before passing to acme client
$key_length = (string) $certObj->keyLength;
$key_length = substr($key_length, 4);
if ($key_length == 'ec256' || $key_length == 'ec384') {
if ($acme_action == "renew") {
// if it's renew then pass --ecc to acme client to locate the correct cert directory
$acme_args[] = "--ecc";
}
$key_length = substr_replace($key_length, '-', 2, 0);
}