Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

How to verify certificate in transport

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


berberic at fmi

Jul 25, 2008, 1:27 PM

Post #1 of 3 (270 views)
Permalink
How to verify certificate in transport

Hello,

I want to send mails to a smarthost encrypted. My attempts to do it
over smtps failed, I suppose this can't be done with exim4.

So I tried to force TLS. I already have added a “hosts_require_tls” to
the “remote_smtp_smarthost” transport to prevent unencrypted delivery.

I tried adding “tls_certificate = …/bla.crt” to make exim check the
server-certificate against bla.crt, but this gives me:

TLS error on connection to smarthost [ip] (cert/key setup:
cert=…/bla.crt key=…/bla.crt): Base64 unexpected header error.

So how do I make exim to check the certificate to prevent
man-in-the-middle attacks?

MfG
bmg

--
„Des is völlig wurscht, was heut beschlos- | M G Berberich
sen wird: I bin sowieso dagegn!“ | berberic[at]fmi.uni-passau.de
(SPD-Stadtrat Kurt Schindler; Regensburg) | www.fmi.uni-passau.de/~berberic

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


hs at schlittermann

Jul 26, 2008, 12:17 PM

Post #2 of 3 (247 views)
Permalink
Re: How to verify certificate in transport [In reply to]

M G Berberich <berberic[at]fmi.uni-passau.de> (Fr 25 Jul 2008 22:27:40 CEST):
> Hello,
>
> I want to send mails to a smarthost encrypted. My attempts to do it
> over smtps failed, I suppose this can't be done with exim4.
>
> So I tried to force TLS. I already have added a “hosts_require_tls” to
> the “remote_smtp_smarthost” transport to prevent unencrypted delivery.
>
> I tried adding “tls_certificate = …/bla.crt” to make exim check the
> server-certificate against bla.crt, but this gives me:

The "tls_certificate" option is not for checking, it's for telling exim
which certificate it should use as client talking to the remove server.

>
> TLS error on connection to smarthost [ip] (cert/key setup:
> cert=…/bla.crt key=…/bla.crt): Base64 unexpected header error.

something like this should do the trick:

TLS_CRT = /etc/ssl/certs/ssl.schlittermann.de.crt
TLS_KEY = /etc/ssl/private/ssl.schlittermann.de.key
TLS_CA = /etc/ssl/certs/ca-certificates.crt


smtp_tls:
driver = smtp
hosts_require_tls = *
tls_certificate = TLS_CRT
tls_privatekey = TLS_KEY
tls_verify_certificates = TLS_CA


I'm just not sure, if this setup already checks the certificates CN
against the host connected to. But I'd guess, this information could be
found in the spec file.


Best regards from Dresden
Viele Grüße aus Dresden
Heiko Schlittermann
--
SCHLITTERMANN.de ---------------------------- internet & unix support -
Heiko Schlittermann HS12-RIPE -----------------------------------------
gnupg encrypted messages are welcome - key ID: 48D0359B ---------------
gnupg fingerprint: 3061 CFBF 2D88 F034 E8D2 7E92 EE4E AC98 48D0 359B -


--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


exim-users at spodhuis

Jul 26, 2008, 3:08 PM

Post #3 of 3 (249 views)
Permalink
Re: How to verify certificate in transport [In reply to]

On 2008-07-25 at 22:27 +0200, M G Berberich wrote:
> I want to send mails to a smarthost encrypted. My attempts to do it
> over smtps failed, I suppose this can't be done with exim4.

Correct, to the best of my knowledge. SSL-on-connect is not in any
standards documents and is something the IETF argues against
(unfortunately, IMO).

> So I tried to force TLS. I already have added a “hosts_require_tls” to
> the “remote_smtp_smarthost” transport to prevent unencrypted delivery.
>
> I tried adding “tls_certificate = …/bla.crt” to make exim check the
> server-certificate against bla.crt, but this gives me:

No, tls_certificate is how you tell Exim what its *own* TLS certificate
is.

> So how do I make exim to check the certificate to prevent
> man-in-the-middle attacks?

On the smarthost transport, you set tls_verify_certificates to point to
the CA certificates (a file for GnuTLS, a file or a directory for
OpenSSL, eg, /etc/ssl/certs/).

For *server* side, you can choose which hosts to optionally verify for,
independently of having configured certificates (tls_verify_hosts,
tls_try_verify_hosts). But for the *client* side, once you provide the
CA certs, verification is mandatory and there are no hooks to disable
it. There's only so many ways that Exim will let people shoot
themselves in their own foot and this isn't one of them. :)

Note that tls_verify_certificates is the name of *two* options,
depending upon where it's set, with the same meaning for both. If it's
set in the 'main' section of the configuration, then it's a server-side
setting and if it's set on an SMTP Transport, then it's a client-side
setting. Neither affects the other.

-Phil

--
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.