Home > freitagsrunde > OpenSSL certificates with multiple domains (common names)

OpenSSL certificates with multiple domains (common names)

At Freitagsrunde, we are currently installing an ejabberd Jabber server, and came across the problem of using one SSL certificate for multiple host names. While the old anwer to this problem is using one IP address for each hostname, or wildcard certificates, one of us proposed a solution unknown to the others before: SSL certificates with more than one common name, aka Unified Communications Certificates.

# copy the system's openssl config
$ cp /etc/ssl/openssl.cnf .
# patch
$ cat<<EOF | patch
--- openssl.cnf.orig	2008-04-10 18:01:37.000000000 +0200
+++ openssl.cnf	2008-04-10 18:02:18.000000000 +0200
@@ -141,8 +141,14 @@
organizationalUnitName		= Organizational Unit Name (eg, section)
#organizationalUnitName_default	=

-commonName			= Common Name (eg, YOUR name)
-commonName_max			= 64
+0.commonName			= Common Name 1
+0.commonName_max			= 64
+
+1.commonName			= Common Name 2
+1.commonName_max			= 64
+
+2.commonName			= Common Name 3
+2.commonName_max			= 64

emailAddress			= Email Address
emailAddress_max		= 64
EOF
# now create a certificate with this config
$ openssl req -newkey rsa:4096 -nodes -keyout ssl.key -out ssl.pem -config openssl.cnf
...Organizational Unit Name (eg, section) []:
Common Name 1 []:goodpoint.de
Common Name 2 []:*.goodpoint.de
Common Name 3 []:*.*.goodpoint.de
Email Address []:...

And for all remaining sceptics, these certificates will even be signed by CaCert.org:

Categories: freitagsrunde Tags:
  1. Voyageur
    April 11th, 2008 at 19:24 | #1

    When I added such a certificate to my personal server, I had taken the lazy way: the script found at http://wiki.cacert.org/wiki/VhotTaskForce#head-3d83d9023bb008fd77fa46767335179a73081b62

    Same trick, and it works great :)

  2. Voyageur
    April 11th, 2008 at 19:26 | #2

    Hmm I copied too much of the link, check point 9.1 directly at http://wiki.cacert.org/wiki/VhostTaskForce (interesting read in any case)

  1. No trackbacks yet.