modification du challenge pour certbot
This commit is contained in:
@@ -101,10 +101,19 @@ setup_ssl() {
|
|||||||
echo "🔄 Test de génération d’un nouveau certificat SSL via HTTP..."
|
echo "🔄 Test de génération d’un nouveau certificat SSL via HTTP..."
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
certbot certonly --standalone --dry-run -d "$fqdn" --non-interactive --agree-tos --register-unsafely-without-email
|
# Vérification que le dossier webroot existe
|
||||||
|
webroot_path="/var/www/cedrix"
|
||||||
|
if [[ ! -d "$webroot_path" ]]; then
|
||||||
|
echo "❌ Le dossier $webroot_path n'existe pas. Apache n'a pas été installé..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "🔍 Test de génération de certificat via webroot ($webroot_path)..."
|
||||||
|
|
||||||
|
certbot certonly --webroot -w "$webroot_path" --dry-run -d "$fqdn" --non-interactive --agree-tos --register-unsafely-without-email
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
echo "✅ Test réussi, génération réelle du certificat..."
|
echo "✅ Test réussi, génération réelle du certificat..."
|
||||||
certbot certonly --standalone -d "$fqdn" --non-interactive --agree-tos --register-unsafely-without-email
|
certbot certonly --webroot -w "$webroot_path" -d "$fqdn" --non-interactive --agree-tos --register-unsafely-without-email
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo "⚠️ Échec du test via HTTP. Tentative via DNS..."
|
echo "⚠️ Échec du test via HTTP. Tentative via DNS..."
|
||||||
@@ -133,6 +142,7 @@ setup_ssl() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
echo "✅ Certificat SSL généré avec succès."
|
echo "✅ Certificat SSL généré avec succès."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user