Google recently announced that it is going to start prioritising websites that offer HTTPS by default in its search engine results. At first, the positive effect will be small to give webmasters time to switch to HTTPS, but it will gradually become more of a significant signal. This is a good thing for the internet: SSL doesn't cost much for webhosts, and it makes it more difficult to spy on everyone all the time! The Electronic Frontier Foundation praised the decision calling it a "bold and welcome move to protect users". I wanted to start offering some of the services I run on my server to other friends and family, and I couldn't easily install the CAcert root on all of their devices, so this seemed like a good time to purchase a cert. The following describes how I configured the various services (Apache, Postfix, Dovecot) to use the new certificate from COMODO.
Differences to CAcert certificate
Until now, I have used a certificate signed by CAcert for the site and used Apache's mod_rewrite to redirect unauthenticated users (everyone except me) back to http. I chose to do this because unless the CAcert root was installed on the client machine, the users would get a browser error; I also didn't want Google crawling the HTTPS site and penalising me for having duplicate content (http and https). Configuring Apache and the other services to use the cert signed by CAcert was easy because it was signed directly by the CAcert root: I just had to give Apache a path to the new certificate file, it sent the cert to clients when they made a connection, and it was accepted because it was signed by a trusted root certificate. However, commercial certificate authorities generally don't use their root certificates to validate domains because having the root key in constant use increases the likelihood that the key could be compromised. Instead, they use the root key to sign an intermediate certificate, and then use the intermediate key to validate domains. If they didn't do this and the root key was compromised, every operating system would have to push an update to remove the compromised root certificate from the trusted certificate store on users' machines; this way, if the intermediate key is compromised the certificate authority can revoke the intermediate cert and generate a new one without the root certificate being affected. The small downside of this is that Apache now needs to send a string of certs to each client containing every certificate between yours and the root cert, or the client will just check to see if your cert was signed directly by a root CA in its trusted certificate store, and reject it if it wasn't. The string of certs forms a chain of trust, i.e. "the samhobbs.co.uk_cert was signed by intermediate_cert which was signed by root_ca". So, the first thing I had to do was concatenate the certificate files to make one jumbo certificate file.
Creating a certificate bundle
Comodo sent me a .zip archive
samhobbs_co_uk.zip containing the following files:
To unzip the archive use the
mkdir ~/certs mv samhobbs_co_uk.zip ~/certs/samhobbs_co_uk.zip cd ~/certs unzip samhobbs_co_uk.zip
The order of the certs in the concatenated file is important: you want your certificate at the top of the file, the one that signed your cert (intermediate1) below that, and the one that signed that one (intermediate2) below that. The root certificate should be left off the file: each client will already have a copy of this file in its trusted certificate store... and if they don't then sending them it won't help, the cert will still be rejected! Actually, the RFC for TLS says that you MAY include the anchor (root cert), which means it will work either way... but the QUALYS SSL Labs test, which we will be using later, will flag it up as an anomaly if you do. So... which file is which? You can get information about certs in a human readable format by using this command:
openssl x509 -text -in /path/to/your/cert.crt
Certificate: Data: Version: 3 (0x2) Serial Number: 96:3b:4e:d8:b9:2c:7a:6c:1d:08:4f:fd:e1:c0:3f:3a Signature Algorithm: sha256WithRSAEncryption Issuer: C=GB, ST=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA Validity Not Before: Aug 15 00:00:00 2014 GMT Not After : Aug 14 23:59:59 2019 GMT Subject: OU=Domain Control Validated, OU=PositiveSSL, CN=samhobbs.co.uk Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: 00:d3:a3:1a:49:1f:02:6e:a5:38:75:0f:32:2f:89: fc:a0:b3:e5:51:0f:25:c4:17:5c:3c:82:1a:ea:df: a5:ad:03:f0:e3:76:8d:b7:7a:80:8c:41:88:8f:34: 26:01:a3:b2:49:60:d1:7c:39:ac:ed:31:5f:30:6a: b7:54:2a:f4:ee:a3:a7:c2:1b:5b:14:17:94:b2:9a: 16:87:04:43:d7:12:25:8e:ef:2a:ac:5e:24:3f:73: 12:c0:27:ff:26:f5:3a:8b:64:89:01:32:d8:db:f6: f6:19:7b:b4:4e:82:14:6a:a2:de:db:dc:c3:b6:76: 08:47:48:a0:30:7a:31:b2:7c:38:b1:c1:2f:b4:bc: 7c:61:3e:76:ea:c1:97:47:29:d7:5c:cb:77:4d:a6: 68:5f:34:57:dc:36:ec:27:c3:b8:98:9a:8c:d3:15: c4:7d:bd:5c:f0:9d:49:27:d2:6e:a9:f7:51:b3:16: 58:4f:b0:36:45:33:93:81:7c:8d:93:16:ca:dd:20: 21:84:c6:e1:a4:ce:72:b3:1f:6f:84:f2:89:65:4e: ce:1e:b8:ef:f3:06:4a:4a:44:a7:99:20:06:72:c8: 50:9f:37:e2:39:be:ea:1f:75:5c:0a:69:6f:e2:4e: 99:88:89:18:8e:16:51:b3:35:1b:52:29:1a:77:9b: 82:79 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Authority Key Identifier: keyid:90:AF:6A:3A:94:5A:0B:D8:90:EA:12:56:73:DF:43:B4:3A:28:DA:E7 X509v3 Subject Key Identifier: 81:6A:52:BA:72:60:2F:A3:F1:9F:00:20:36:0A:E9:14:BC:37:BC:C3 X509v3 Key Usage: critical Digital Signature, Key Encipherment X509v3 Basic Constraints: critical CA:FALSE X509v3 Extended Key Usage: TLS Web Server Authentication, TLS Web Client Authentication X509v3 Certificate Policies: Policy: 18.104.22.168.4.1.6422.214.171.124.3.4 CPS: https://secure.comodo.net/CPS Policy: 126.96.36.199.2.1 X509v3 CRL Distribution Points: Full Name: URI:http://crl.comodoca.com/COMODORSADomainValidationSecureServerCA.crl Authority Information Access: CA Issuers - URI:http://crt.comodoca.com/COMODORSADomainValidationSecureServerCA.crt OCSP - URI:http://ocsp.comodoca.com X509v3 Subject Alternative Name: DNS:samhobbs.co.uk, DNS:www.samhobbs.co.uk Signature Algorithm: sha256WithRSAEncryption 0c:29:6b:2a:18:d4:25:54:9c:88:6a:3d:1c:8b:2f:99:0f:88: 10:4f:11:56:cd:28:cc:67:6f:d3:de:c6:f1:54:f8:b5:1a:b7: 6b:94:9c:74:7c:e2:41:49:46:ed:a7:c2:49:c6:5b:c2:02:c9: 08:c8:26:fd:f2:15:1d:28:c8:24:ca:aa:6a:e2:1e:74:96:9c: d1:f9:78:58:3a:f2:8c:bf:e7:f9:37:3b:eb:ac:c5:09:3f:23: fc:63:4a:aa:d9:64:38:78:5b:83:69:81:b2:a6:3e:83:a6:bd: 9a:2a:82:4e:3d:ee:ec:15:2f:53:a7:b2:00:89:e2:97:d2:ee: 6a:75:38:9a:7c:8b:c6:67:fe:be:7f:0f:ee:24:8c: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65FW1sHuBUZ6zy1I58Ms= -----END CERTIFICATE-----
And if you just want to know who issued the cert (who signed it) then use this command:
openssl x509 -noout -in samhobbs_co_uk.crt -issuer
issuer= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
So we can see that my cert was signed by
COMODORSADomainValidationSecureServerCA.crt. Using the same command on the other certs reveals that the order, from root to my cert, is:
- AddTrustExternalCARoot.crt (ROOT)
So, to combine all of these files into one we can use the
cat command, listing them in reverse order and omitting the root cert:
cat samhobbs_co_uk.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt > samhobbs.co.uk-new.ca-bundle
So, now that we have a combined certificate file, let's configure Apache2, Dovecot and Postfix to use it: In the following examples, I'm using these paths as an example:
- The certificate (on its own) is located at
- The certificate bundle is located at
- The key file is located at
In your postfix configuration file
/etc/postfix/main.cf, find these two parameters and edit them to match these lines:
As you can see, Postfix only needs the certificate bundle and the key file; the certificate file on its own is not used.
The SSL configuration for Dovecot is found at
/etc/dovecot/conf.d/10-ssl.conf, and needs the key file and the certificate bundle, similar to Postfix:
ssl_cert = </etc/ssl/certs/samhobbs.co.uk-new.ca-bundle ssl_key = </etc/ssl/private/samhobbs.co.uk-new.key
< isn't a mistake, don't leave it out!
Apache2 is the odd one out here, because it requires three parameters in versions before 2.4.8, like so:
SSLCertificateFile /etc/ssl/certs/samhobbs.co.uk-new.crt SSLCertificateChainFile /etc/ssl/certs/samhobbs.co.uk-new.ca-bundle SSLCertificateKeyFile /etc/ssl/private/samhobbs.co.uk-new.key
I.e. the cert on its own, the certificate bundle and the key file. In new versions (greater than 2.4.8) things have improved:
SSLCertificateChainFile is depreciated;
SSLCertificateFile was extended so that you can pass it a certificate bundle... so now Apache just needs two parameters:
SSLCertificateFile /etc/ssl/certs/samhobbs.co.uk-new.ca-bundle SSLCertificateKeyFile /etc/ssl/private/samhobbs.co.uk-new.key
If you're not sure which version of Apache you're running, you can check with this command:
At the time of writing (01 Sep 2014), the version of Apache2 in the Ubuntu 14.04 repositories is 2.4.7 and the version in the Raspbian/Debian stable repos is 2.2.22; both of these packages use the "old way" but Ubuntu will soon get the new version.
HTTP Strict Transport Security (HSTS)
If your site is HTTPS only, you can make use of a technology called HTTP Strict Transport Security (HSTS), where Apache sends a header to the client's browser that tells it to always connect with HTTPS. This site is using HSTS now: if you have visited before and you type http://samhobbs.co.uk in your browser it will rewrite to https://samhobbs.co.uk before it sends a request to my server. This is different to rewriting HTTP to HTTPS on the server because the rewrite is done client side, and can help prevent certain kinds of Man In The Middle (MITM) attacks. Note that you still need to have a HTTP virtualhost that rewrites to HTTPS because this only works when someone has visited to the site before: new users will need a server-side rewrite before their browser has stored the header. Setting up HSTS is really simple: all you need to do is add this to your HTTPS virtualhost:
Header add Strict-Transport-Security "max-age=15768000"
And then reload Apache:
sudo service apache2 reload
Obviously, don't do this for sites where you actually want to have separate HTTP and HTTPS sites on the same domain name, or you won't be able to access the HTTP site without clearing your cache to remove the header.
Perfect Forward Secrecy
While we are talking about SSL, I thought I'd mention Perfect Forward Secrecy (PFS). This is technology that helps protect users by ensuring that if a SSL key is decrypted in the future it couldn't be used to decrypt past sessions that were captured (by security services or your ISP, for example). Or in other words (from the EFF article below):
When an encrypted connection uses perfect forward secrecy, that means that the session keys the server generates are truly ephemeral, and even somebody with access to the secret key can't later derive the relevant session key that would allow her to decrypt any particular HTTPS session. So intercepted encrypted data is protected from prying eyes long into the future, even if the website's secret key is later compromised.
You can read more about PFS on the EFF's website. So, how do we configure PFS on Apache? Luckily, there are already some useful guides at scottlinux.com and ggramaize.wordpress.com, and the Mozilla wiki is useful too. I don't have any special knowledge of the various ciphers used in SSL/TLS, so the configuration below was taken from the Mozilla wiki, using the backward compatible ciphersuite. The order of the list prioritises strong ciphers that support forward secrecy. First, you need Apache 2.3.3 or higher (see earlier in this article for how to check your version). Next, put this inside your SSL virtualhost:
SSLProtocol all -SSLv2 SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128:AES256:AES:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK SSLHonorCipherOrder on SSLCompression off
I followed the instructions listed here with a comodo SSL certificate and have succeeded in setting up Apache without any issues but dovecot keeps giving me an issue when I attempt to log into the mail server: Fatal: Can't load private ssl_key: Key is for a different cert than ssl_cert.
I have verified that the key and crt file match through https://www.sslchecker.com/matcher and verified the path to the files in the configuration file. Any ideas what may be causing the issue?
Just a couple of questions, if I may:
- while generating the certificate at Comodo, it asks "Select the server software used to generate the CSR". One who followed the steps in your "SSL Certificate Signing with CAcert for Raspberry Pi, Ubuntu & Debian" should select which option?
- I was recently advised to stop using SSLv3 (use TLS only) due to a vulnerability called POODLE (disablessl3.com) - have you heard about this before?
SSLProtocol all -SSLv2 -SSLv3Sam
Sorry to come back to this but the reason I asked in the first place is because openssl is not listed as an option... :-) I'll try some options until it works.
Regarding SSLv3, I had to also disable it for Postfix (main.cf) and Dovecot (10-ssl).
There are like over 20 options so it's probably better if you take a look at https://secure.instantssl.com/products/SSLIdASignup1a
I know I'm pushing this perhaps a bit too far but your help would be most appreciated.
Not sure what is wrong with the link but I guess that is not important: for the record, I tried the "OTHER" option and everything is working just fine.
Thanks for looking into this anyway.
I've gone down the Comodo SSL route also for my site and all has gone well aside from the Dovecot aspect!
The site now defaults to the https:// version when visited but when you go to the squirrelmail (on Chrome) it red crosses through the https and states that the page it connects with has insecure connections. It wont take too much imagination to see the page yourself as i've not change from the default url on squirrelmail yet.
I can only assume that is the Dovecot aspect its complaining about!
The mail logs show no errors and the same certificate / key works fine for postfix and the main site.
Any thoughts?? I've gone round in circles most of the evening trying to get to the bottom of this one?!
<img src="http://m.arkadiem.co.uk/images/arkadiem_logo.png" alt="aRKaDieM Web Mail Logo" height="85" width="266">Nice site by the way, I really like the design. Sam
Thanks Sam that does indeed appear to be the issue. I've moved the image to the secure image store and go the padlock back!
When logged in - however there is a warning triangle but it still appears sucure, do you have that too? Is it due to the plugins / addons in SquirrelMail do you think?
On another note - I had this in my inbox this morning:
Transcript of session follows.
Out: 220 arkadiem.co.uk ESMTP Postfix (Debian/GNU)
In: EHLO a9-82.smtp-out.amazonses.com
Out: 250-SIZE 10240000
Out: 250-AUTH PLAIN LOGIN
Out: 250 DSN
Out: 454 4.7.0 TLS not available due to local problem
Session aborted, reason: lost connection
Looking into it my logs show the following:
Apr 12 08:21:10 arkadiem postfix/smtpd: initializing the server-side TLS engine
Apr 12 08:21:10 arkadiem postfix/smtpd: warning: cannot get RSA private key from file /etc/ssl/private/www_arkadiem_co_uk.key: disabling TLS support
Apr 12 08:21:10 arkadiem postfix/smtpd: warning: TLS library problem: 20052:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:x509_cmp.c:330:
I have checked both the certificate and key and both are valid and working through the commands:
openssl rsa -in /etc/ssl/private/www_arkadiem_co_uk.key -text -noout
openssl x509 -in /etc/ssl/certs/www_arkadiem_co_uk.ca-bundle -text -noout
I've checked a few other forums etc but nothing seems to work to get postfix to use TLS with the new certs.
I'm happy to e-mail logs / config files directly if your willing to look?
p.s. Thanks for the love on the site :) I've worked hard on simplicity and functionality!!
I'll take look at roundcube...i'm unning all this on a my rpi2 which is barely breaking a sweat so it'll be interesting to see if how it runs on it!
I've gone through the inspect and cant see anything - frankly im not that worried as it gives a green tick when logged in - just a few warnings which migrating to roundcube may fix!?
With the certs..exactly the same file location (/etc/ssl/certs|private/) as apache2, dovecot and postfix which is what is confsuing me as its working on apache2.
I looked at the permissions and even went as far as copying the cert and key to a new location specific to postfix with chmod 640 and chown to postfix:postfix. Still got the same error.
Currently they are owned by root with -rw-r--r-- for both the key and ca-bundle.
If I change the owner I would be better copying the certificates into sperate areas for each service so they have the correct ownership if thats required.
Confused as everything seems to be working fine - just not encrypting the TLS which amazon wanted to use (hence the webmaster error email).
I changed the certs and key to 640 but still get the same key errors.
Changing to the snake-oil default SSL makes it work and when I send myself a secure mail from a gmail account you can see in the logs it working as intended!
Can you think of a reason not to keep the configuration in this way? My take is that its only a local server SSL authentication that should never be seen from outside my network so it shouldn't matter that its a self signed internal SSL.
Good tip on roundcube btw! It looks great and very straight forward - just got some sending issues but i'm running multiple apache2 over two rpi's to keep my weather data flowing so I wont bore you with that one :)
Thanks for your input Sam, much appriciated! Got it all sorted now.
The .key file was absolutly fine, the .ca-bundle was absolutly fine, the .crt was absolutly fine - but when I ran the following:
openssl x509 -noout -modulus -in cert.ca-bundle | openssl md5
openssl x509 -noout -modulus -in cert.crt | openssl md5
openssl rsa -noout -modulus -in cert.key | openssl md5
It showed a miss-match between the ca-bundle and the key, however it did match on the .crt!
So confused as to why thats the case as all were in the .zip from Comodo but hey thats life!
Despite checking this earlier today it all comes clear after wasting a day going around in circles!
Long story short - thank you, my Comodo SSL is now covering apache2, dovecot and postfix without error :)
Oh and I found out about roundcube!
Thanks again mate!
Which Comodo SSL cert would you advise? My site is only for owncloud, squirrelmail and a basic website one day. I see thee are various types of SSL certs from Comodo. I think I'm going to give up on the CAcert, because I can't seem to get it working properly...I'll just pay Comodo and hope I can have pi-box.co.uk SSL by default too.
I purchased the Comodo Positive SSL and changed the certs paths for the vhosts in dovecot, postfix and apache and squirrelmail. Like before with CAcert my site is unavailble...
I'm at my wits end and am confident that the issue must be my vhosts. I've read the vhosts tutorial a few times after printing it out to see what I've done wrong but can't put my finger on it. I've commented out all my vhosts apache.conf, default-ssl.conf, main.cf, 10-ssl.conf with the hope that I can focus on one vhost at a time and bring apache back to life...
Is there any way that you could possibly help, please?
Still working to make sense of it all...Apache2 error.log shows a mismatch between my domain.ca-bundle and domain.key
[Sun Mar 06 20:10:28.748533 2016] [ssl:emerg] [pid 7063] AH02565: Certificate and private key pi-box.co.uk:443:0 from /etc/ssl/certs/pi-box_co_uk.ca-bundle and /etc/ssl/private/pi-box.co.uk.key do not match
Following your guide, but I didn't receive seperate files from Comodo...they already had a ca-bundle and the crt file...
Any idea how to fix it?
1) The key is the correct one - pi-box.co.uk-new.key [the ca-bundle was created using pi-box_co_uk.ca-bundle...do the file names matter? Should it be identical?]
2) Apache2 version 2.4.10 and I don't know if the ca-bundle contains the cert...I checked the ca-bundle...has 3 files (encryptions) in it. I used the 2nd of the two methods.
Do I need to combine the ca-bundle and the crt? Like you did here:
So, to combine all of these files into one we can use the cat command, listing them in reverse order and omitting the root cert:
cat samhobbs_co_uk.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt > samhobbs.co.uk-new.ca-bundle
But like so:
cat pi-box_co_uk.crt pi-box_co_uk.ca-bundle > pi-box.co.uk-new.ca-bundle
...and try it again?
Glad to announce that my Comodo SSl certs are now finally working. The cat command gave me a permissions error, even if I used sudo...so I used sudo nano to copy and paste the crt into the ca-bundle, putting the crt at the top...and then it worked.
Squirrelmail is now using the ssl cert. No to get owncloud on ssl!
Many many thanks for all your support!
Thanks for that...I also have a p7b file that came from Comodo...I don't know what it does...
My https://pi-box.co.uk/squirrelmail works perfectly on ssl...but when I tried https://pi-box.co.uk/owncloud it gives an error on port 443. I played around a bit with default-ssl.conf but can't get owncloud to work via https://pi-box.co.uk/owncloud or http://pi-box.co.uk/owncloud. When I comment out the vhost for apache.conf https force part port 80 and leave the rest I get both squirrelmail and owncloud via http and obviously not via https.
I therfore assume that owncloud will need it's own vhost or default-ssl need to be configured 'better'. The other thing I also noticed is that when I only go to http://pi-box.co.uk or https://pi-box.co.uk they default to squirrelmail...
Owncloud still doesn't work for me regarding SSL. I've tried everything my knowledge and understanding allows up to now. Squirrelmail works fine via SSL, but not Owncloud...I know it has to be a vhost somewhere and I've tinkered with it loads the last few days, but to no avail. I can get to 192.168.1.100/owncloud in a round about way by adding some settings in default-ssl, but when I change it to try and get to it from outside the LAN, it doesn't work.
I glad to announce my site is now SSL by default! Woop woop! It was a struggle for me to sort the vhosts out especially with Owncloud...I eventually found a post on a forum where someone called Feathers McGraw used you site as an example and suggested that the owncloud vhost for port 443 is placed above the squirrelmail port 443 vhost because apache.conf runs before default-ssl.conf on the apache server...
It didn't make a lot of sense to me but I tried it and it worked! I also deleted all the lines of code that wasn't needed for my owncloud vhosts in my attempt to get owncloud to work outside my LAN.
I learned a lot in this process and kudos once again to you for your tutorials.