apache_autoconf(): déploiement des certificats autorité
This commit is contained in:
		
							parent
							
								
									775a02119e
								
							
						
					
					
						commit
						16d95d2a73
					
				| @ -259,15 +259,6 @@ function apache_autoconf() { | |||||||
|     [ -n "$wwwdir" ] || wwwdir="$autoconfdir/www" |     [ -n "$wwwdir" ] || wwwdir="$autoconfdir/www" | ||||||
|     [ -n "$certsconfdir" ] || certsconfdir="$autoconfdir/certsconf" |     [ -n "$certsconfdir" ] || certsconfdir="$autoconfdir/certsconf" | ||||||
|     [ -n "$rrdir" ] || rrdir="$autoconfdir/RewriteRules" |     [ -n "$rrdir" ] || rrdir="$autoconfdir/RewriteRules" | ||||||
|     if [ -d "$certsconfdir" ]; then |  | ||||||
|         if [ -z "$certsdir" ]; then |  | ||||||
|             eerror "CERTSDIR est requis si --certsconfdir est spécifié" |  | ||||||
|             return 1 |  | ||||||
|         elif [ ! -d "$certsdir" ]; then |  | ||||||
|             eerror "$certsdir: répertoire invalide" |  | ||||||
|             return 1 |  | ||||||
|         fi |  | ||||||
|     fi |  | ||||||
| 
 | 
 | ||||||
|     # Faire un script sed pour remplacer les variables spécifiées par leur |     # Faire un script sed pour remplacer les variables spécifiées par leur | ||||||
|     # valeur dans les fichiers |     # valeur dans les fichiers | ||||||
| @ -284,10 +275,10 @@ function apache_autoconf() { | |||||||
|     ac_set_tmpfile FILLTEMP |     ac_set_tmpfile FILLTEMP | ||||||
| 
 | 
 | ||||||
|     # Copie des certificats |     # Copie des certificats | ||||||
|     local modified conf |     local modified rehash conf | ||||||
|     if [ -d "$certsconfdir" ]; then |     if [ -d "$certsconfdir" ]; then | ||||||
|         local -a certsconfs |         local -a certsconfs certspems | ||||||
|         local certsconf cert key ca |         local certsconf certspem cert key ca | ||||||
|         array_addu FILLVARS cert |         array_addu FILLVARS cert | ||||||
|         array_addu FILLVARS key |         array_addu FILLVARS key | ||||||
|         array_addu FILLVARS ca |         array_addu FILLVARS ca | ||||||
| @ -295,10 +286,24 @@ function apache_autoconf() { | |||||||
|         etitle "Installation des certificats" |         etitle "Installation des certificats" | ||||||
|         array_lsfiles certsconfs "$certsconfdir" "*.conf" |         array_lsfiles certsconfs "$certsconfdir" "*.conf" | ||||||
|         for certsconf in "${certsconfs[@]}"; do |         for certsconf in "${certsconfs[@]}"; do | ||||||
|  |             if [ -z "$certsdir" ]; then | ||||||
|  |                 eerror "CERTSDIR est requis si --certsconfdir est spécifié" | ||||||
|  |                 return 1 | ||||||
|  |             elif [ ! -d "$certsdir" ]; then | ||||||
|  |                 eerror "$certsdir: répertoire invalide" | ||||||
|  |                 return 1 | ||||||
|  |             fi | ||||||
|             apache_resolvecert "$certsconf" "$certsdir" cert key ca || return 1 |             apache_resolvecert "$certsconf" "$certsdir" cert key ca || return 1 | ||||||
|             apache_addcert -y "$cert" "$key" "$ca" |             apache_addcert -y "$cert" "$key" "$ca" | ||||||
|             modified=1 |             modified=1 | ||||||
|         done |         done | ||||||
|  |         array_lsfiles certspems "$certsconfdir" "*.crt" "*.pem" | ||||||
|  |         for certspem in "${certspems[@]}"; do | ||||||
|  |             if copy_update "$certspem" "$APACHESSLCERTSDIR/$(basename -- "$certspem")"; then | ||||||
|  |                 modified=1 | ||||||
|  |                 rehash=1 | ||||||
|  |             fi | ||||||
|  |         done | ||||||
|         eend |         eend | ||||||
|     fi |     fi | ||||||
| 
 | 
 | ||||||
| @ -499,8 +504,11 @@ s#@@ca@@#$APACHESSLCERTSDIR/$(basename "$ca")#g | |||||||
|         eend |         eend | ||||||
|     fi |     fi | ||||||
| 
 | 
 | ||||||
|     if [ -n "$modified" -a -n "$restart" ]; then |     if [ -n "$modified" ]; then | ||||||
|         estep "Redémarrage d'apache" |         [ -n "$rehash" ] && elinedots "Hashage des certificats" c_rehash | ||||||
|         "$APACHECTL" restart |         if [ -n "$restart" ]; then | ||||||
|  |             estep "Redémarrage d'apache" | ||||||
|  |             "$APACHECTL" restart | ||||||
|  |         fi | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user