Dovecot Failed to initialize SSL server context

Joseph Tam jtam.home at gmail.com
Fri Apr 17 00:28:39 EEST 2020


Adam Raszkiewicz <araszkiewicz at medallies.com> writes:

> I'm trying to configure TLS for Dovecot 2.3 but after setting all things up I'm
> not able to start  Dovecot:
>
>     Apr 16 20:56:25 imap-login: Error: Failed to initialize SSL server context:
> Can't load SSL private key: Key is for a different cert than ssl_cert: user=<>,
> rip=::1, lip=::1, secured, session=<JKh/qm6j/rMAAAAAAAAAAAAAAAAAAAAB>

This is your problem -- you have a mismatch between key and certificate.
Check again using doveconf your certificate and key file ocations they
correspond to what you expect.

> I have created a brand new key pair, csr and the cert but still it complains to
> start.
> 
> Any thoughts on that?

You normally don't use the CSR, but you can check all the files to make
sure the modulus matches and they belong to each other

 	openssl x509 -in file.crt -noout -modulus
 	openssl rsa -in file.key -noout -modulus
 	openssl req -in file.csr -noout -modulus

Joseph Tam <jtam.home at gmail.com>


More information about the dovecot mailing list