GNU/Linux >> Linux Esercitazione >  >> Cent OS

Let's Encrypt:il client non dispone di un'autorizzazione sufficiente ::Risposta non valida

Recentemente ho iniziato a utilizzare i certificati SSL Let's Encrypt per il mio sito cPanelTips.com. Ammettiamolo, Let's Encrypt ha cambiato il modo in cui installiamo i certificati SSL.

I vecchi tempi in cui dovevi inserire la tua azienda e i tuoi dati personali, generare il codice CSR e quindi inviarlo al registrar SSL, per aspettare finalmente che il codice CRT fosse sparito.

Let's Encrypt è un modo semplice e veloce per installare certificati SSL sia per cPanel che per semplici server Linux. Nel mio caso, questi certificati SSL sono stati installati su CentOS 7.x 64 bit e funzionano perfettamente fino alla data di scadenza per il rinnovo SSL.

Tuttavia, quando stava per arrivare il momento del rinnovo del certificato SSL di Let's Encrypt, ho notato qualcosa di strano durante l'esecuzione dell'opzione "rinnova" utilizzando il comando "certbot". Vedi sotto.

[[email protected]:~]/usr/bin/certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Cert is due for renewal, auto-renewing...
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for nixcp.com
Waiting for verification...
Cleaning up challenges
Attempting to renew cert from /etc/letsencrypt/renewal/nixcp.com.conf produced an unexpected error: Failed authorization procedure. nixcp.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://nixcp.com/.well-known/acme-challenge/qtxjYi0a3FYNWpvqW-WTyZZzj848Yr0J6Sfx-75xDrg

L'errore era evidente:

Il client non dispone di un'autorizzazione sufficiente ::Risposta non valida da http://nixcp.com/.well-known/acme-challenge/

Nello stesso processo di rinnovo ho visto anche un altro errore su un altro sito web che gestisco:

All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/mysecondsite.com/fullchain.pem (failure)
1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: mysecondsite.com
   Type:   unauthorized
   Detail: Invalid response from
   http://mysecondsite.com/.well-known/acme-challenge/YjP9PAcIEANeX50kZJ9vJ-lARkryYs7yFSLhKBU9Y_M:
   404 Not Found

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A record(s) for that domain
   contain(s) the right IP address. The A records were configured ok at the DNS server, and the first thing that came to my mind was that certbot was trying to connect to http://, instead of https://.

Avevo configurato questi due domini per utilizzare un reindirizzamento 301 da http a https, ho testato questo curl in esecuzione su http per vedere se c'era un problema con il reindirizzamento 301, ma per quanto ne vedo non era quello il problema.

curl -I http://nixcp.com/.well-known/acme-challenge/

Ha restituito uno stato OK di reindirizzamento 301, quindi perché certbot non è in grado di raggiungere l'URL finale?

Non lo so, ma c'è qualcosa che ha funzionato. Ho creato un'eccezione per il reindirizzamento 301 da http a https e ciò ha reso il processo di rinnovo di certbot eseguito senza problemi per entrambi i domini.

Questo era il codice che ho usato per reindirizzare 301 tutto da http a https ad eccezione della directory .well nota utilizzata da Let's Encrypt:

server {
   listen 80;
   server_name www.nixcp.com nixcp.com;
   
    # Redirect all requests to https
    location / {
        return 301 https://nixcp.com$request_uri;
    }

    # This rule excludes the .well-known directory from the 301 redirect.
    location /.well-known {
        root /var/www/nixcp.com;
    }
}

Lasciare la directory .well nota accessibile tramite http è stata la chiave per eseguire il processo di rinnovo di certbot senza problemi. Successivamente, mi sono assicurato che la directory di verifica utilizzata da certbot fosse stata effettivamente creata:

mkdir -p /var/www/caneltips.com/.well-known/acme-challenge

Dopodiché ho eseguito di nuovo il comando di rinnovo e questo è stato il risultato:

È stato rinnovato OK per altri 3 mesi! 🙂

Let's Encrypt:Il client non ha un'autorizzazione sufficiente ::La risposta non valida è stata modificata l'ultima volta:5 aprile 2017 da Esteban Borges
Cent OS
  1. Creare fiducia nella comunità Linux

  2. SSL gratuito per Nginx su Centos di Let's encrypt

  3. Come crittografare la partizione domestica?

  4. Come installare Let's Encrypt con Apache su CentOS 7

  5. CentOS / RHEL 6,7:Come eliminare una destinazione iSCSI sull'iniziatore (client iSCSI)

Aggiungi client al server FreeIPA su CentOS 8

Come installare Let's Encrypt su Nginx

Come installare Let's Encrypt SSL con Nginx su CentOS 7

Assegna Let's Encrypt a un sito web

Come proteggere Apache con Let's Encrypt su CentOS 8

Come proteggere Nginx con Let's Encrypt su CentOS 8