neilpang 2019-04-21 12:37:26 +08:00
parent 9ff53fea98
commit e6df1828d9

14
acme.sh
View File

@ -1006,10 +1006,20 @@ _createkey() {
if _isEccKey "$length"; then
_debug "Using ec name: $eccname"
${ACME_OPENSSL_BIN:-openssl} ecparam -name "$eccname" -genkey 2>/dev/null >"$f"
if _opkey="$(${ACME_OPENSSL_BIN:-openssl} ecparam -name "$eccname" -genkey 2>/dev/null)"; then
echo "$_opkey" >"$f"
else
_err "error ecc key name: $eccname"
return 1
fi
else
_debug "Using RSA: $length"
${ACME_OPENSSL_BIN:-openssl} genrsa "$length" 2>/dev/null >"$f"
if _opkey="$(${ACME_OPENSSL_BIN:-openssl} genrsa "$length" 2>/dev/null)"; then
echo "$_opkey" >"$f"
else
_err "error rsa key: $length"
return 1
fi
fi
if [ "$?" != "0" ]; then