Set up SSL/TLS with Let's Encrypt
A fresh WisMail server starts with a self-signed certificate, so browsers and mail apps warn about it. This guide replaces it with a trusted certificate from Let's Encrypt, which WisMail can issue and renew by itself, or with a certificate you already own. Allow about 10 minutes. For the feature overview see SSL/TLS and Let's Encrypt.
How it works
WisMail talks to Let's Encrypt with the ACME v2 protocol and proves that you control the host name with an http-01 challenge: Let's Encrypt connects to your server on port 80 using the name you ask for, and WisMail answers the challenge. That is why three things must be true before you start:
- The host name (for example
mail.example.com) has an A record pointing to this server. See DNS setup. - Port 80/TCP is open from the internet to the server, both in the server firewall and in your provider's firewall.
- The server can reach Let's Encrypt over outbound HTTPS.
The same certificate then protects web administration (port 4040), webmail, IMAPS, POP3S, SMTPS and the HTTPS services such as ActiveSync and CalDAV.
Step 1. Open the certificates page
Log in to web administration (https://<host-name>:4040/admin/) and open Configuration, SSL Certificates. The list shows the certificates the server holds, their issuer, the expiry date and which one is Active.
Step 2. Issue a Let's Encrypt certificate
- Choose New Let's Encrypt Certificate.
- Enter the Hostname: the name your users and devices connect to, such as
mail.example.com. It is one host name per certificate. - Click OK and wait. The dialog stays busy while the server completes the ACME order, usually under a minute.
On success the new certificate appears in the list with a Let's Encrypt badge. If it fails, a message shows the reason reported by the certificate authority; see the troubleshooting section below.
Step 3. Make it the active certificate
Select the new certificate and choose Make active. The server then uses it for all secure services. Changing the certificate while the server runs can confuse a browser that is already logged in to web administration: if the page does not load correctly afterwards, close the browser completely and open it again.
Step 4. Turn on auto-renewal
Open Renewal for the Let's Encrypt certificate and tick Enable auto renewal. The server checks the certificate every day and renews it before it expires. You can also tick Remove previous certificate after renewal to keep the list tidy. Renewal needs the same conditions as issuing: port 80 reachable by that host name. You can start a renewal by hand with Renew.
Use your own certificate instead
If you buy certificates from a commercial authority, or need one certificate for several names (a SAN or wildcard certificate, for example one that also covers autodiscover.example.com), import it:
- Choose Import certificate.
- Select the certificate file (
.crtor.pem) and the matching private key file (.keyor.pem); enter the key password if the key has one. - Select the imported certificate and choose Make active.
To work from a certificate signing request, choose Create signing request (CSR), send the request to your authority, then use Complete CSR to load the signed certificate. To keep things simple while testing you can also generate a self-signed certificate (validity 1 to 10 years).
Give the server certificate to devices
For devices that must trust a certificate they do not already trust (an internal or self-signed one), select the certificate and choose Download to save the server certificate, then install it on the device. With a Let's Encrypt or other public certificate this is not needed, because phones and computers already trust the authority.
Check the result
From any computer:
echo | openssl s_client -connect mail.example.com:993 -servername mail.example.com 2>/dev/null | openssl x509 -noout -issuer -dates
The issuer must be Let's Encrypt and the dates must be in the future. In a browser, open https://mail.example.com/ and check there is no warning.
Troubleshooting
Issuing fails with a connection or challenge error. Port 80 is not reachable. Test from outside with curl -I http://mail.example.com/. Open port 80 in the server firewall (for example sudo ufw allow 80/tcp) and in your hosting provider's firewall, then try again. See also install guide, step 4.
Issuing fails with a name error. The host name does not resolve to this server yet. Check dig +short A mail.example.com returns the server IP, and wait for DNS to propagate.
Only the first name works. The Let's Encrypt screen issues for one host name. Use an imported certificate for several names.
Renewal stopped. Port 80 was closed or DNS changed. Fix it, then press Renew and check the new expiry date.
Next steps
- Set up DNS records for the host name.
- Install guide if you have not finished the first setup.
- Pricing or the free trial.