Hey Edwin,
First, I made a few minor edits to the default zmssl.cnf.in:
1) uncomment the line
copy_extensions = copy
in the [CA_default] section, which causes openssl to copy any
extensions in a certificate request to the signed certificate.
2) uncomment the line
req_extensions = v3_req
in the [req] section, which causes certificate requests to be
generated with any extensions specified in the [v3_req] section.
3) add the line
subjectAltName=
DNS:host.domain1.com,DNS:host.domain2.com,etc..
in the [v3_req] section, resulting in the Subject Alt Name extension
being added to any generated certificate requests.
4) This was the part that stumped me: why wasn't the web server showing
any X.509 extensions in its SSL certificate? It turns out that this
was because zmcreatecert uses Java's keytool (not openssl) to generate
certificate requests, and keytool doesn't use zmssl.cnf, meaning that
it didn't even look for extensions.
However, I worked around the problem for now by adding the extensions
at the signing stage in zmcreatecert, adding the following arguments
to the second call of openssl in signCertReq():
-extensions v3_req -extfile ${BASE}/zmssl.cnf
This causes openssl to append the extensions (the same ones it did
to the smtpd certificate request) to the signed Tomcat certificate.
Voila!