Update 3/21/12: I’ve revised the instructions so that Webconfig serves the entire StartCom chain. This prevents some browsers, particularly Android, from distrusting an an otherwise-valid certificate.
As previously described, I use ClearOS as an all-purpose small business server. There are two public-facing components: Webconfig (remote admin) and SOGo (groupware, proxied thru Apache). By default, ClearOS secures both with self-signed SSL certificates. While this works, it’s unprofessional and inconvenient to make users add a security exception to every browser they connect from.
Inspired by this post, I decided to try a Class 1 cert from StartCom. They provide free certs valid for one year (more info at SSL Shopper). Once you’ve signed up with StartCom and validated your domain ownership:
- Change the default message digest parameter in
/etc/ssl/openssl.cnf
from MD5 to SHA1:
default_md = sha1
(both lines) - Delete the System Certificate
- Create a CSR for the System Certificate
- Provide the CSR to StartCom and retrieve the cert.
- Upload the cert into Webconfig. This will create
/etc/ssl/sys-0-cert.pem
and/etc/ssl/private/sys-0-key.pem
You can now configure Apache (web pages and SOGo):
- Download the certificate chain (
ca.pem
andsub.class1.server.ca.pem
) to/etc/ssl
- Modify
/etc/httpd/conf.d/ssl.conf
:
SSLCertificateFile /etc/ssl/sys-0-cert.pem
SSLCertificateKeyFile /etc/ssl/private/sys-0-key.pem
SSLCertificateChainFile /etc/ssl/sub.class1.server.ca.pem
SSLCACertificateFile /etc/ssl/ca.pem - Restart Apache:
service httpd restart
Webconfig uses a different Apache instance with configuration files in /usr/webconfig/conf
.
- Overwrite the self-signed cert and key and set proper ownership:
cp /etc/ssl/sys-0-cert.pem /usr/webconfig/conf/server.crt cp /etc/ssl/private/sys-0-key.pem /usr/webconfig/conf/server.key chown root /usr/webconfig/conf/server.*
- Copy the StartCom chain and set proper ownership:
cp /etc/ssl/ca.pem /usr/webconfig/conf/ cp /etc/ssl/sub.class1.server.ca.pem /usr/webconfig/conf/ chown root /usr/webconfig/conf/*.pem
- Modify
/usr/webconfig/conf/extra/httpd-ssl.conf
:
SSLCertificateFile /usr/webconfig/conf/sys-0-cert.pem
SSLCertificateKeyFile /usr/webconfig/conf/private/sys-0-key.pem
SSLCertificateChainFile /usr/webconfig/conf/sub.class1.server.ca.pem
SSLCACertificateFile /usr/webconfig/conf/ca.pem - Restart Webconfig:
service webconfig restart
Use the SSL Checker to verify that Apache is serving the entire chain for both sites.
If you connect to the IMAP server (Cyrus) directly:
- Copy the files and set proper ownership:
cp /etc/ssl/sys-0-cert.pem /etc/imapd.d/cert.pem cp /etc/ssl/private/sys-0-key.pem /etc/imapd.d/key.pem chown cyrus:root /etc/imapd.d/*.pem
- Restart Cyrus
service cyrus-imapd restart
If you connect to the SMTP server (Postfix) directly:
- Copy the files and set proper ownership:
cp /etc/ssl/sys-0-cert.pem /etc/postfix/cert.pem cp /etc/ssl/private/sys-0-key.pem /etc/postfix/key.pem chown root:root /etc/postfix/*.pem
- Restart Postfix
service postfix restart