I configured SSL by adding these strings to 01_exim4-config_listmacrosdefs
. I use split configuration
MAIN_TLS_ENABLE = yes
MAIN_TLS_CERTKEY = /etc/exim4/example.com.crt
MAIN_TLS_PRIVATEKEY = /etc/exim4/example.com.key
So after restarting, connecting to port 465, typing EHLO
and STARTTLS
I got this: 454 TLS currently unavailable
In the log I have this:
13:29:36 10872 SMTP<< STARTTLS
13:29:36 10872 initialising GnuTLS as a server
13:29:36 10872 GnuTLS global init required.
13:29:36 10872 initialising GnuTLS server session
13:29:36 10872 Expanding various TLS configuration options for session credentials.
13:29:36 10872 certificate file = /etc/exim4/example.com.crt
13:29:36 10872 key file = /etc/exim4/example.com.crt
13:29:36 10872 LOG: MAIN
13:29:36 10872 TLS error on connection from (192.168.1.111) [91.210.44.50] (cert/key setup: cert=/etc/exim4/example.com.crt key=/etc/exim4/example.com.crt): Error in parsing.
Why does exim use the same file both for certificate and key? How to fix?
I should have used
MAIN_TLS_CERTIFICATE
instead ofMAIN_TLS_CERTKEY
.@chicks I'd upvote if serverfault would let me.
Still snagging people (i.e., me over two years later).
Technically, the comments in
conf.d/main/03_exim4-config_tlsoptions
say that if you have the certificate and key in the same file, then useMAIN_TLS_CERTKEY
. That's bad practice but allowed.I glossed over that and went straight to the
ifdef
statements. The first of those is:and I completely missed the
.else
part:TL;DR: Yes, set
MAIN_TLS_CERTIFICATE
rather thanMAIN_TLS_CERTKEY
.