Today, I was trying to learn how to use OpenSSL to create a multi-domain certificate. By mistake, I did not find a way to use OpenSSL to create a multi-domain certificate, the keytool is used to generate the multi-domain SSL self-signed certificate for Tomcat. The method is very simple:
After JDK is installed and environment variables are configured, run the following command to generate a self-signed multi-domain certificate:
Keytool-genkey-alias server-keyalg RSA-keysize 1024-keypass econfpass-keystore D: \ keystore \ Server. jks-storepass econfpass-validity 36500-dname "cn = domain name 1, Cn = domain name 2, Cn = Domain Name 3, ou = test, O = test, L = test, st = test, c = test"
In this way, server. jks supports "Domain Name 1, domain name 2, and domain name 3" at the same time ".
When configuring the Tomcat server. xml file, note that for keystore configuration, you cannot enable APR connector, that is, you must set
<Listener classname = "org. Apache. Catalina. Core. aprlifecyclelistener" sslengine = "on"/>
Comment out because the certificate format required by APR connector is the certificate format supported by Apache.