I have taken a working HTTPS certificate from a server that I want to use on the same server, just on a different port. The certificate has a Subject Alternative Name defined in it. Using keytool, I generated a new keystore, added the existing certificate, and restarted Tomcat. However, when I get to the site, it still says that it is insecure. The errors say the certificate has no SAN, and it looks like the certificate is now listed as self-signed. Any idea why this is happening and how to get a secure, valid https connection?
These are the commands I ran:
keytool -genkey -alias myalias -keyalg RSA -keystore "C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf\Keystore\keystore"
importing signed certificate
keytool -importcert -file certfromgissite.cer -keystore keystore
So after those two commands are run, my keystore has the privateKeyEntry and the trustedCertEntry.