I have 2 certificates signed by CA. I want to enable ssl on tomcat using these certificates.
I ran the following commands to create jks file and imported the certificates into that jks file.
1. keytool -genkey -alias bmark.com -keyalg RSA -keystore keystore.jks
2. keytool -import -alias root -keystore keystore.jks -trustcacerts -file b32dasd75493.crt
3. keytool -import -alias intermed -keystore keystore.jks -trustcacerts -file sf_bundle-g2-g1.crt
And enabled https in server.xml of tomcat
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="/Users/test/Desktop/keystore.jks" keystorePass="changeme"/>
Started tomcat and opened url https://bmark.com:8080 in chrome but it claims that CA-signed SSL certificate is not trusted, claims it is self-signed. Do I need any other files apart from these? How can I resolve this issue?
b32dasd75493.crt
almost certainly is -- to the privatekey entry which is definitely-alias bmark.com
(2) 'bundle' is usually multiple certs -- if so you may need to break them apart and import them separately (3) you need to connect using the public name. You've only fixed (3), not (1) and (2). Your failure to do (1) is the reason tomcat uses and browser gets a selfsigned cert.keytool -printcert -v -sslserver $host[:$port]
(this shows exactly what it is serving. Did the bundle tell you which cert is what? If not, look at each withkeytool -printcert -file $file
and make sure of the subject and issuer.{,www.}antiquearts.com
issued Dec 2 by letsencrypt, plus the correct letsencrypt intermediate and no root (which is permitted, but not usual for Java) and it identifies as Apache2.4.6 on CentOS not Tomcat.