# Disabe letsencrypt fallito e Run discourse-setup ha avuto un allarme non normale

**URL:** https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452
**Category:** Self-hosting
**Created:** [25 Settembre 2021, 5:43pm UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452 "2021-09-25T17:43:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![luxame19](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@luxame19](https://meta.discourse.org/u/luxame19)
#### Post date: [25 Settembre 2021, 5:43pm UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/1 "2021-09-25T17:43:48Z")

</div>

Sto cercando di riconfigurare il certificato SSL e vorrei disabilitare il certificato gratuito di Let’s Encrypt.  
Poiché possiedo un certificato acquistato, ho trovato alcune indicazioni su Google.

Ho modificato direttamente `app.yml` e confermato che le chiavi e i certificati in `/var/discourse/shared/standalone/ssl/` hanno nomi di file coerenti con il file di configurazione, poi ho eseguito la ricompilazione. Il risultato è stato un fallimento: il sistema continua a utilizzare il certificato di Let’s Encrypt.

Nel log di nginx compaiono alcuni errori:

```plaintext

2021/09/25 16:37:26 [emerg] 48#48: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:27 [emerg] 78#78: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:28 [emerg] 80#80: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:29 [emerg] 82#82: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:30 [emerg] 95#95: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:31 [emerg] 104#104: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:32 [emerg] 106#106: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

```

Ho verificato che i file esistano nella directory:

```plaintext
root@discourse-test:/var/discourse/shared/standalone/ssl# ls -al ssl.*
-rw-r--r-- 1 root root 7868 Sep 25 16:24 ssl.cer
-rw------- 1 root root 1675 Sep 25 16:24 ssl.key

```

Ho inoltre trovato alcune discussioni al seguente URL:

[Rimuovere Let’s Encrypt dalle opzioni di installazione](https://meta.discourse.org/t/removing-lets-encrypt-from-installation-choice/92366)

Quando eseguo `./discourse-setup`, ricevo questo avviso:

```plaintext
./discourse-setup: line 471: [: 1234567890123456: binary operator expected

```

Avete qualche suggerimento per disabilitare Let’s Encrypt o risolvere il problema di riconfigurazione?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [25 Settembre 2021, 5:57pm UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/2 "2021-09-25T17:57:42Z")

</div>

Ci sono alcuni argomenti su come utilizzare il proprio certificato. Puoi provare a cercare, ma questa nicchia è trattata qui: [Configurazione avanzata esclusiva: abilitazione di SSL/HTTPS per la tua configurazione Docker di Discourse](https://meta.discourse.org/t/advanced-setup-only-allowing-ssl-https-for-your-discourse-docker-setup/13847)

---

<div class="post-metadata">

### Author: ![luxame19](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@luxame19](https://meta.discourse.org/u/luxame19)
#### Post date: [25 Settembre 2021, 6:10pm UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/3 "2021-09-25T18:10:16Z")

</div>

Ciao [pfaffman](https://meta.discourse.org/u/pfaffman)

Grazie per la tua risposta.  
Per le informazioni che hai fornito, ho già un riferimento e un esperimento.  
Ma il risultato è fallito, il servizio nginx non riesce a leggere il file.

Il messaggio di errore è descritto sopra:

```plaintext
2021/09/25 16:37:26 [emerg] 48#48: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:27 [emerg] 78#78: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:28 [emerg] 80#80: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:29 [emerg] 82#82: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:30 [emerg] 95#95: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:31 [emerg] 104#104: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

2021/09/25 16:37:32 [emerg] 106#106: cannot load certificate "/shared/ssl/ssl.crt": BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/shared/ssl/ssl.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

```

---

<div class="post-metadata">

### Author: ![luxame19](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@luxame19](https://meta.discourse.org/u/luxame19)
#### Post date: [25 Settembre 2021, 7:24pm UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/4 "2021-09-25T19:24:47Z")

</div>

Sono riuscito a utilizzare il mio certificato.

Continuavo a usare il nome errato del file delle credenziali: le impostazioni di nginx richiedono un file `crt`, ma continuavo a installare e testare un file `cer`.  
Quindi, ho risolto il problema SSL.

Grazie

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [26 Settembre 2021, 12:15am UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/5 "2021-09-26T00:15:31Z")

</div>

Qualcosa che è saltato agli occhi nei tuoi primi due post è stato

```plaintext
cannot load certificate "/shared/ssl/ssl.crt"

```

e  
Hai confermato che il file è presente nella directory

```plaintext
root@discourse-test:/var/discourse/shared/standalone/ssl# ls -al ssl.*

```

* * *

Notare la differenza dopo la parte `/shared/` dei percorsi. Nginx si aspettava che il file ssl.crt fosse nella cartella `shared/ssl/`. L’hai trovato invece in `shared/standalone/`. Il file non si trovava nel percorso in cui Nginx lo stava cercando.

---

<div class="post-metadata">

### Author: ![luxame19](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@luxame19](https://meta.discourse.org/u/luxame19)
#### Post date: [30 Settembre 2021, 6:06am UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/6 "2021-09-30T06:06:02Z")

</div>

@JimPas Grazie per la risposta.  
Ho fornito informazioni sul fatto che il percorso non corrisponde, perché un percorso è quello di un volume Docker e l’altro è quello reale del file sul server.

[Solo configurazione avanzata: Abilitare SSL/HTTPS per la tua installazione Discourse Docker](https://meta.discourse.org/t/advanced-setup-only-allowing-ssl-https-for-your-discourse-docker-setup/13847)

```plaintext
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared

```

sembra non corrispondere, ma in realtà è lo stesso.  
Il primo problema è stato risolto.  
La causa principale per me è che non ho notato il formato del certificato.  
La configurazione richiede il formato `crt`, ma ho sempre utilizzato file nel formato `cer`, quindi nginx non è riuscito a leggere correttamente il file del certificato.

---

<div class="post-metadata">

### Author: ![JimPas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimpas/32/148179_2.png) [@JimPas](https://meta.discourse.org/u/JimPas)
#### Post date: [30 Settembre 2021, 6:33am UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/7 "2021-09-30T06:33:29Z")

</div>

> [@luxame19](#):
>
> `-rw-r--r-- 1 root root 7868 Sep 25 16:24 ssl.cer`

🤦‍♂️  
Non me ne ero mai accorto. Beh, datemi un richiamo!  
Sono contento che tu te ne sia reso conto e l’abbia risolto. 👍

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [30 Ottobre 2021, 6:34am UTC](https://meta.discourse.org/t/disabe-letsencrypt-failed-and-run-discourse-setup-had-some-not-normal-alert/204452/8 "2021-10-30T06:34:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
