Detailed explanation of SSL configuration differences between Tomcat 7, 8, 9, and 10 versions to help you correctly configure SSL certificates
| Tomcat Version | Java Version Requirement | TLS 1.2 | TLS 1.3 | HTTP/2 | Status |
|---|---|---|---|---|---|
| Tomcat 7.x | Java 6/7 | ✅ | ❌ | ❌ | Deprecated |
| Tomcat 8.x | Java 7/8 | ✅ | ❌ | ⚠️ Needs Configuration | Stable |
| Tomcat 9.x | Java 8+ | ✅ | ✅ | ✅ | Recommended |
| Tomcat 10.x | Java 11+ | ✅ | ✅ | ✅ | Current |
Tomcat requires certificates in Java keystore format (.jks or .p12). If you receive .crt and .key files, you need to convert them to keystore format first.
# # Merge certificate chain (if needed)cat your_domain.crt intermediate_ca.crt > fullchain.crt
# # Convert to PKCS12 formatopenssl pkcs12 -export -out your_domain.p12 -inkey your_domain.key -in fullchain.crt -name tomcat
# # System will prompt you to set password, please keep this password safe
# # Convert from PKCS12 to JKSkeytool -importkeystore -srckeystore your_domain.p12 -srcstoretype PKCS12 -destkeystore your_domain.jks -deststoretype JKS
# # Or create JKS directly from certificate and private key (need to convert to PKCS12 first)
Tomcat SSL configuration is done in server.xml file, need to configure HTTPS connector.
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
scheme="https" secure="true"
keystoreFile="/path/to/your_domain.p12"
keystorePass="your_keystore_password"
keystoreType="PKCS12"
clientAuth="false" sslProtocol="TLS" />
port:port: HTTPS port, default 8443, production environment recommends using 443keystoreFile:keystoreFile: Keystore file path (absolute path)keystorePass:keystorePass: Keystore passwordkeystoreType:keystoreType: Keystore type, PKCS12 or JKSclientAuth:clientAuth: Whether to require client certificate, usually set to false<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="/path/to/your_domain.jks"
keystorePass="password"
keystoreType="JKS"
clientAuth="false" sslProtocol="TLS" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
scheme="https" secure="true"
keystoreFile="/path/to/your_domain.p12"
keystorePass="password"
keystoreType="PKCS12"
clientAuth="false" sslProtocol="TLS" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
scheme="https" secure="true"
keystoreFile="/path/to/your_domain.p12"
keystorePass="password"
keystoreType="PKCS12"
clientAuth="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1.2,TLSv1.3"
ciphers="TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
scheme="https" secure="true"
keystoreFile="/path/to/your_domain.p12"
keystorePass="password"
keystoreType="PKCS12"
clientAuth="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1.2,TLSv1.3"
ciphers="TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" />
# # View PKCS12 keystorekeytool -list -v -keystore your_domain.p12 -storetype PKCS12
# # View JKS keystorekeytool -list -v -keystore your_domain.jks
# # Change PKCS12 keystore passwordkeytool -storepasswd -keystore your_domain.p12 -storetype PKCS12
# # Change JKS keystore passwordkeytool -storepasswd -keystore your_domain.jks
# # Import intermediate certificate to PKCS12keytool -import -trustcacerts -alias intermediate -file intermediate.crt -keystore your_domain.p12 -storetype PKCS12
# # Import intermediate certificate to JKSkeytool -import -trustcacerts -alias intermediate -file intermediate.crt -keystore your_domain.jks
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
SSLEnabled="true"
sslEnabledProtocols="TLSv1.2,TLSv1.3"
sslProtocol="TLS"
... />
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
SSLEnabled="true"
sslEnabledProtocols="TLSv1.2,TLSv1.3"
sslProtocol="TLS"
... />
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true"
scheme="https" secure="true"
keystoreFile="/etc/tomcat/ssl/your_domain.p12"
keystorePass="${catalina.base}/conf/keystore.pass"
keystoreType="PKCS12"
clientAuth="false"
sslProtocol="TLS"
sslEnabledProtocols="TLSv1.2,TLSv1.3"
ciphers="TLS_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256"
maxHttpHeaderSize="8192" />
Error: Error: java.io.IOException: keystore was tampered with, or password was incorrect
Solution:
Error: Error: Address already in use
Solution:
Error: Error: javax.net.ssl.SSLHandshakeException
Solution:
Solution: Problem: Application cannot run after upgrading from Tomcat 9 to Tomcat 10
Solution: