[comment]: # translation:outdated

[comment]: # ({64bb0393-64bb0393})
# 2 Problemi con i certificati

[comment]: # ({/64bb0393-64bb0393})

[comment]: # ({123d3f4b-123d3f4b})
#### OpenSSL utilizzato con CRL e per alcune CA nella catena del certificato la relativa CRL non è inclusa in `TLSCRLFile`

Nel log del server TLS nel caso di un peer *OpenSSL*:

    failed to accept an incoming connection: from 127.0.0.1: TLS handshake with 127.0.0.1 returned error code 1: \
        file s3_srvr.c line 3251: error:14089086: SSL routines:ssl3_get_client_certificate:certificate verify failed: \
        TLS write fatal alert "unknown CA"

Nel log del server TLS nel caso di un peer *GnuTLS*:

    failed to accept an incoming connection: from 127.0.0.1: TLS handshake with 127.0.0.1 returned error code 1: \
        file rsa_pk1.c line 103: error:0407006A: rsa routines:RSA_padding_check_PKCS1_type_1:\
        block type is not 01 file rsa_eay.c line 705: error:04067072: rsa routines:RSA_EAY_PUBLIC_DECRYPT:paddin

[comment]: # ({/123d3f4b-123d3f4b})

[comment]: # ({7be8a029-7be8a029})
#### CRL scaduta o in scadenza durante il funzionamento del server

[*OpenSSL*]{.underline}, nel log del server:

-   prima della scadenza:

```{=html}
<!-- -->
```
    cannot connect to proxy "proxy-openssl-1.0.1e": TCP successful, cannot establish TLS to [[127.0.0.1]:20004]:\
        SSL_connect() returned SSL_ERROR_SSL: file s3_clnt.c line 1253: error:14090086:\
        SSL routines:ssl3_get_server_certificate:certificate verify failed:\
        TLS write fatal alert "certificate revoked"

-   dopo la scadenza:

```{=html}
<!-- -->
```
    cannot connect to proxy "proxy-openssl-1.0.1e": TCP successful, cannot establish TLS to [[127.0.0.1]:20004]:\
        SSL_connect() returned SSL_ERROR_SSL: file s3_clnt.c line 1253: error:14090086:\
        SSL routines:ssl3_get_server_certificate:certificate verify failed:\
        TLS write fatal alert "certificate expired"

Il punto qui è che con una CRL valida un certificato revocato viene segnalato
come "certificate revoked". Quando la CRL scade, il messaggio di errore cambia in
"certificate expired", il che è piuttosto fuorviante.

[*GnuTLS*]{.underline}, nel log del server:

-   prima e dopo la scadenza è lo stesso:

```{=html}
<!-- -->
```
    cannot connect to proxy "proxy-openssl-1.0.1e": TCP successful, cannot establish TLS to [[127.0.0.1]:20004]:\
          invalid peer certificate: The certificate is NOT trusted. The certificate chain is revoked.

[comment]: # ({/7be8a029-7be8a029})

[comment]: # ({d0a3efb1-e3030ed0})
#### Certificato autofirmato, CA sconosciuta

[*OpenSSL*]{.underline}, nel log:

    error:'self signed certificate: SSL_connect() set result code to SSL_ERROR_SSL: file ../ssl/statem/statem_clnt.c\
          line 1924: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:\
          TLS write fatal alert "unknown CA"'

Questo è stato osservato quando il certificato del server, per errore, aveva la stessa stringa Issuer
e Subject, anche se era stato firmato dalla CA. Issuer e Subject sono
uguali nel certificato CA di livello superiore, ma non possono essere uguali nel certificato del server.
(Lo stesso vale per i certificati di proxy e agent.)

Per verificare se un certificato contiene le stesse voci Issuer e Subject, eseguire:

```
openssl x509 -in <yourcertificate.crt> -noout -text
```

È accettabile che il certificato root (di livello superiore) abbia valori identici per Issuer e Subject.

[comment]: # ({/d0a3efb1-e3030ed0})
