[comment]: # ({64bb0393-64bb0393})
# 2 Problemy z certyfikatem

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

[comment]: # ({123d3f4b-123d3f4b})
#### OpenSSL używany z listami CRL i dla części CA w łańcuchu certyfikatów ich CRL nie jest dołączona w `TLSCRLFile`

W logu serwera TLS w przypadku peera *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"

W logu serwera TLS w przypadku peera *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})
#### Lista CRL wygasła lub wygasa podczas działania serwera

[*OpenSSL*]{.underline}, w logu serwera:

-   przed wygaśnięciem:

```{=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"

-   po wygaśnięciu:

```{=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"

Chodzi o to, że przy prawidłowej liście CRL unieważniony certyfikat jest zgłaszany
jako "certificate revoked". Gdy lista CRL wygaśnie, komunikat o błędzie zmienia się na
"certificate expired", co jest dość mylące.

[*GnuTLS*]{.underline}, w logu serwera:

-   przed i po wygaśnięciu tak samo:

```{=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})
#### Certyfikat z podpisem własnym, nieznane CA

[*OpenSSL*]{.underline}, w logu:

    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"'

Zaobserwowano to, gdy certyfikat serwera przez pomyłkę miał taki sam ciąg znaków Issuer
i Subject, mimo że został podpisany przez CA. Issuer i Subject są
równe w certyfikacie głównego CA, ale nie mogą być równe w certyfikacie serwera.
(To samo dotyczy certyfikatów proxy i agent.)

Aby sprawdzić, czy certyfikat zawiera takie same wpisy Issuer i Subject, uruchom:

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

Dopuszczalne jest, aby certyfikat root (najwyższego poziomu) miał identyczne wartości Issuer i Subject.

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