support csr that contains empty CN field. fix https://github.com/Neilpang/acme.sh/issues/306
							parent
							
								
									59649e9b1e
								
							
						
					
					
						commit
						ad752b317d
					
				
							
								
								
									
										16
									
								
								acme.sh
								
								
								
								
							
							
						
						
									
										16
									
								
								acme.sh
								
								
								
								
							| 
						 | 
				
			
			@ -2597,10 +2597,11 @@ signcsr(){
 | 
			
		|||
  _initpath
 | 
			
		||||
 | 
			
		||||
  _csrsubj=$(_readSubjectFromCSR "$_csrfile")
 | 
			
		||||
  if [ "$?" != "0" ] || [ -z "$_csrsubj" ] ; then
 | 
			
		||||
  if [ "$?" != "0" ] ; then
 | 
			
		||||
    _err "Can not read subject from csr: $_csrfile"
 | 
			
		||||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
  _debug _csrsubj "$_csrsubj"
 | 
			
		||||
 | 
			
		||||
  _csrdomainlist=$(_readSubjectAltNamesFromCSR "$_csrfile")
 | 
			
		||||
  if [ "$?" != "0" ] ; then
 | 
			
		||||
| 
						 | 
				
			
			@ -2609,6 +2610,19 @@ signcsr(){
 | 
			
		|||
  fi
 | 
			
		||||
  _debug "_csrdomainlist" "$_csrdomainlist"
 | 
			
		||||
  
 | 
			
		||||
    
 | 
			
		||||
  if [ -z "$_csrsubj" ] ; then
 | 
			
		||||
    _csrsubj="$(_getfield "$_csrdomainlist" 1)"
 | 
			
		||||
    _debug _csrsubj "$_csrsubj"
 | 
			
		||||
    _csrdomainlist="$(echo "$_csrdomainlist" | cut -d , -f 2-)"
 | 
			
		||||
    _debug "_csrdomainlist" "$_csrdomainlist"
 | 
			
		||||
  fi
 | 
			
		||||
  
 | 
			
		||||
  if [ -z "$_csrsubj" ] ; then
 | 
			
		||||
    _err "Can not read subject from csr: $_csrfile"
 | 
			
		||||
    return 1
 | 
			
		||||
  fi
 | 
			
		||||
  
 | 
			
		||||
  _csrkeylength=$(_readKeyLengthFromCSR "$_csrfile")
 | 
			
		||||
  if [ "$?" != "0" ] || [ -z "$_csrkeylength" ] ; then
 | 
			
		||||
    _err "Can not read key length from csr: $_csrfile"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue