Bei vielen SSL Zertifikats-Anbietern, wie z.B: StartSSL muss man noch die intermediate Zertifikate, bzw. die certificate chain angeben, damit das Zertifikat als gültig anerkannt wird.
Dies ist vor allem wichtig, da ab PHP 5.6 sämtliche SSL-Verbindungen ohne gültiges Zertifikat abgelehnt werden.
Während es beim apache webserver dafür eine eigene direktive gibt, müssen bei dovecot und postfix alle Intermediate-Zertifikate in die Datei des Zertifikats der Domain rein:
cat domain.crt intermediate.crt > domain.chain.crt |
Testen kann man die Verbindung mittels:
openssl s_client -showcerts -connect mail.example.com:465 # SMTP openssl s_client -showcerts -connect mail.example.com:993 # IMAP |
In der Ausgabe sieht man oben die Validierung der Zertifikate (depth / Certificate chain) und unten der exit code (Verify return code: 0 (ok)):
CONNECTED(00000003)
depth=2 C = IL, O = StartCom Ltd., OU = Secure Digital Certificate Signing, CN = StartCom Certification Authority
verify return:1
depth=1 C = IL, O = StartCom Ltd., OU = StartCom Certification Authority, CN = StartCom Class 2 IV Server CA
verify return:1
depth=0 C = CH, ST = Ort, L = Ort, O = Vorname Nachname, CN = *.example.com
verify return:1
---
Certificate chain
0 s:/C=CH/ST=Ort/L=Ort/O=Vorname Nachname/CN=*.example.com
i:/C=IL/O=StartCom Ltd./OU=StartCom Certification Authority/CN=StartCom Class 2 IV Server CA
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
1 s:/C=IL/O=StartCom Ltd./OU=StartCom Certification Authority/CN=StartCom Class 2 IV Server CA
i:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
---
Server certificate
subject=/C=CH/ST=Ort/L=Ort/O=Vorname Nachname/CN=*.example.com
issuer=/C=IL/O=StartCom Ltd./OU=StartCom Certification Authority/CN=StartCom Class 2 IV Server CA
---
Verify return code: 0 (ok)
---
220 mail.example.com ESMTP Postfix |
One thought on “postfix/dovecot: SSL intermediate/certificate chain”