]> git.proxmox.com Git - mirror_acme.sh.git/commitdiff
fix https://github.com/Neilpang/acme.sh/issues/1189
authorneilpang <neil@neilpang.com>
Tue, 16 Jan 2018 12:55:07 +0000 (20:55 +0800)
committerneilpang <neil@neilpang.com>
Tue, 16 Jan 2018 12:55:07 +0000 (20:55 +0800)
acme.sh

diff --git a/acme.sh b/acme.sh
index 74b437cb2b2e1cb4f2b548e0b07b693cc0835e69..59a7d9609ff3682e49a7ab90f6e8ed6f5f98d3d2 100755 (executable)
--- a/acme.sh
+++ b/acme.sh
@@ -2259,6 +2259,8 @@ _initAPI() {
 
 #[domain]  [keylength or isEcc flag]
 _initpath() {
+  domain="$1"
+  _ilength="$2"
 
   __initHome
 
@@ -2346,13 +2348,10 @@ _initpath() {
     ACME_OPENSSL_BIN="$DEFAULT_OPENSSL_BIN"
   fi
 
-  if [ -z "$1" ]; then
+  if [ -z "$domain" ]; then
     return 0
   fi
 
-  domain="$1"
-  _ilength="$2"
-
   if [ -z "$DOMAIN_PATH" ]; then
     domainhome="$CERT_HOME/$domain"
     domainhomeecc="$CERT_HOME/$domain$ECC_SUFFIX"
@@ -4234,8 +4233,6 @@ signcsr() {
     return 1
   fi
 
-  _initpath
-
   _csrsubj=$(_readSubjectFromCSR "$_csrfile")
   if [ "$?" != "0" ]; then
     _err "Can not read subject from csr: $_csrfile"
@@ -4272,6 +4269,9 @@ signcsr() {
     return 1
   fi
 
+  if [ -z "$ACME_VERSION" ] && _contains "$_csrsubj,$_csrdomainlist" "*."; then
+    export ACME_VERSION=2
+  fi
   _initpath "$_csrsubj" "$_csrkeylength"
   mkdir -p "$DOMAIN_PATH"