Site icon Franky's Web

Let's Encrypt: Free certificates for Exchange Server

Update 12.01.17: This article is outdated, here is an updated version: Exchange 2016: Free certificates from Let's Encrypt

Seit einigen Tagen befindet sich die neue CA „Let’s Encrypt“ in der öffentlichen Beta Phase. Ziel von Let’s Encrypt ist es,auf einfache Weise SSL Zertifikate auszustellen. Die Zertifikate sind obendrein auch noch kostenlos.

Die CA wird bereits durch die meisten Browser unterstützt, da die Let’s Encrypt CA durch Identrust signiert wurde (Cross Signing).

Even though it is currently a beta phase, the certificates can already be used for Exchange test environments, but it is currently still somewhat cumbersome in connection with Exchange Server. There is a Windows Clientbut it didn't really want to run on my test system. It will probably take a little more time for the programs to mature.

Since the Windows clients are not yet ready, I used an Ubuntu Server VM with the LAMP stack installed for this test. The LAMP stack is not actually necessary, but I didn't have anything else to hand :-)

I am using my domain frankysweb.com for my test. I would like to have a certificate issued for my Exchange server that contains the following DNS names:

In other words, a classic SAN certificate with two DNS names.

Let’s Encrypt funktioniert etwas anders, als eine gewöhnliche CA. Bei den meisten CAs gibt es ein Webportal bei dem eine Zertifikatsanforderung (CSR) eingereicht werden muss. Bei Let’s Encrypt erledigt das ein Client. Daher benötigen wir zuerst den Client. Mit dem folgenden Befehl wird der Client aus dem GIT Repository runtergeladen:

git clone https://github.com/letsencrypt/letsencrypt

Sobald der Download fertiggestellt ist, kann in das Verzeichnis „letsencrypt“ gewechselt werden. In dem Verzeichnis befindet sich der Client.

First, the client can be called with the -help parameter; any missing dependencies are then installed:

An dieser Stellt haben wir jetzt also den Let’s Encrypt Client und alle Abhängigkeiten. Es gibt allerdings in diesem Fall ein paar Besonderheiten:

Der PC oder Server der das Zertifikat anfordert, muss unter den angeforderten Domainnamen per Port 80 aus dem Internet erreichbar sein. So wird durch Let’s Encrypt sichergestellt, dass man auch im Besitz der Domain ist, für die das Zertifikat angefordert wird (Domain Validation). Other CAs usually send an e-mail with a link to an e-mail address such as postmaster@domain.de. Bei Let’s Encrypt übernimmt diese Funktion der Client.

Da auf meinem Testserver bereits ein Apache Server auf Port 80 hört, muss der Apache zunächst beendet werden, damit Port 80 für den Let’s Encrypt Client frei wird.

sudo service apache2 stop

To make the test server accessible under the domain names autodiscover,frankysweb.com and outlook.frankysweb.com, I created the two subdomains with my hoster and had them point to my WAN IP:

I then forwarded port 80 on the firewall to my test server via DNAT.

Note: Port 80 is only required for the request, after which the port can be closed again.

Somit ist der Let’s Encrypt Client erreichbar und das Zertifikat kann angefordert werden:

/letsencrypt-auto certonly --standalone -d outlook.frankysweb.com -d autodiscover.frankysweb.com

Only one e-mail address needs to be entered for notifications:

and then agree to the Terms of Service:

After the certificate has been issued, it is saved in the /etc/letsencrypt/live/ folder:

Normally only the root user has access to the /live directory, so log in as root user with the following command:

su -

You can now switch to the corresponding directory. Among other things, the private key (privkey.pem) and the certificate (cert.pem) can now be found there:

However, Windows cannot do much with certificates in PEM format. So the certificate and the private key are converted into PKCS format:

openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out frankyweb.p12

The certificate can now best be copied to the home directory, then it can be easily accessed via WinSCP or similar, without having to adjust the permissions for /etc/letsencrypt/live.

cp frankyweb.p12 /home/frank/frankysweb.p12

The .p12 file can now be transferred to the Exchange Server. The easiest way to do this is probably via WinSCP:

Jetzt kann das Zertifikat importiert werden. Dazu kann eine MMC mit dem „Zertifikate“ SnapIn (lokaler Computer)geladen werden:

The .P12 file can now be imported here:

A glance at the certificate confirms that it is valid. Certificates with a validity period of 3 months are currently issued:

Both DNS names are included:

IdenTrust (DST Root CA X3) hat die Let’s Encrypt Authority X1 signiert, daher ist dieses Zertifikat auf den meisten Browsern und Geräten gültig:

Now assign the Exchange services to the new certificate:

Done:

Das Zertifikat ist erst einmal 3 Monate gültig. Eine Erneuerung funktioniert ebenfalls über den Let’s Encrypt Client. Mal sehen ob nach der Beta Phase auch längere Laufzeiten möglich sind. Es wird sich bestimmt noch viel tun.

It is not yet intended for productive use, but for your own tests and games, why not?

And above all: Kostenlose SAN-Zertifikate einfach per Windows Client anfordern und ggf. noch den IIS gleich mit konfigurieren lassen? Das wäre doch zu schön um wahr zu sein, oder? Genau so ist es aber von Let’s Encrypt vorgesehen. Es bleibt spannend.

Update 12.01.17: This article is outdated, here is an updated version: Exchange 2016: Free certificates from Let's Encrypt

Exit mobile version