Unable to verify the first certificate (Comodo EssentialSSL Wildcard)

I am new to setting up SSL-certificates and working with servers in general, so please bear with me as I try to explain the situation I have put myself in.

I recently acquired an Comodo EssentialSSL Wildcard license that is going to be used for securing my server. The server I am configuring is for use with Kolab. Kolab is working but does not have SSL configured, so I figured I might set that up. I followed the instructions provided on the corresponding Kolab howto-page (https://docs.kolab.org/howtos/secure-kolab-server.html), but got stuck on the section where you set up the cyrus-IMAP server.

When running:

openssl s_client -showcerts -connect example.org:993

I get the following output (truncated):

CONNECTED(00000003)
depth=0 OU = Domain Control Validated, OU = EssentialSSL Wildcard, CN = *.example.org
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 OU = Domain Control Validated, OU = EssentialSSL Wildcard, CN = *.example.org
verify error:num=27:certificate not trusted
verify return:1
depth=0 OU = Domain Control Validated, OU = EssentialSSL Wildcard, CN = *.example.org
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
 0 s:/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.example.org
   i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
-----BEGIN CERTIFICATE-----

...

-----END CERTIFICATE-----
---
Server certificate
subject=/OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.example.org
issuer=/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
---
No client certificate CA names sent
---
SSL handshake has read 2019 bytes and written 421 bytes
---
...

    Start Time: 1502097786
    Timeout   : 300 (sec)
    Verify return code: 21 (unable to verify the first certificate)
---
* OK [CAPABILITY IMAP4rev1 LITERAL+ ID ENABLE AUTH=PLAIN AUTH=LOGIN SASL-IR] example.org Cyrus IMAP git2.5+0-Debian-2.5~dev2015021301-0~kolab2 server ready

If I specify the -CApath to the certificates it does however work and I get the verify return code: 0 (ok), but only if I run the command while logged into the server through ssh. While setting up my mail on thunderbird I can access my mailbox, but have to first add an security exception because the certificate has an "Unknown Identity". The certificate does however work flawlessly on port 443 for https without specifying the -CApath.

Any help would be greatly appreciated.

1
задан 9 August 2017 в 17:04
2 ответа

Я решил проблему, проверив, что порядок моего промежуточного файла пакета был правильно отформатирован, изменил его с .ca-bundle на .pem и добавил следующую строку в мой imapd.conf :

tls_ca_path: /etc/ssl/certs
1
ответ дан 3 December 2019 в 23:27

Если вы получили следующую ошибку во время openssl s_client -showcerts - connect example.com:443[1139578 fasten:

verify error: num = 20:не удалось получить сертификат местного эмитента

. Убедитесь, что вы включили сертификаты пакета CA .

Когда Comodo CA выдает сертификат SSL, он отправит определенный пакет промежуточных сертификатов Comodo CA на установить рядом с ним. Эти сертификаты создают так называемую цепочку сертификатов. Сертификат конечного пользователя был подписан с использованием одного из промежуточных звеньев, который был подписан с использованием одного из корневых сертификатов. Когда браузер переходит на веб-сайт, он пытается построить цепочку сертификатов и связать предоставленный сертификат SSL с одним из корневых источников в своем хранилище доверенных сертификатов.

Убедитесь, что вы загрузили эти файлы от поставщика сертификатов. .

Самый удобный способ (особенно для Nginx ) - объединить их все в один, например, добавив CA Bundle в основной CRT:

$ cat STAR_example_com.ca-bundle > STAR_example_com.crt

Если у вас нет единого .ca-bundle файл (CA Bundle), но несколько файлов, объедините их все в один.

Затем установите STAR_example_com.crt как обычно. Пример для Nginx:

ssl_certificate /etc/nginx/ssl/STAR_example_com.crt;
ssl_certificate_key /etc/nginx/ssl/STAR_example_com.key;
0
ответ дан 3 December 2019 в 23:27

Теги

Похожие вопросы