Fix Tomcat SSL connector config for Tomcat 10.1+ (EL10) - #287
Closed
Odilhao wants to merge 1 commit into
Closed
Conversation
Tomcat 10.1 (shipped on EL10) no longer accepts SSL settings (keystoreFile, keystorePass, sslProtocol, ciphers, clientAuth, etc.) as direct attributes on <Connector>. They must live in a nested <SSLHostConfig>/<Certificate> element instead. Without this, every one of those attributes silently fails to set (digester warnings), no SSLHostConfig gets created, and the connector fails to initialize with: IllegalArgumentException: No SSLHostConfig element was found with the hostName [_default_] to match the defaultSSLHostConfigName so candlepin never listens on its HTTPS port. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
Isn't #286 a better approach? Or wouldn't that work for EL10? |
Member
Author
Looks like it is, I'm testing it right now locally. |
Merged
Member
Author
|
Closing since #286 fix the same issue with a more elegant fix 😄 , the only part that is wrong is the branch name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tomcat 10.1 (shipped on EL10 — CentOS Stream 10 / AlmaLinux 10) dropped support for configuring SSL directly as attributes on
<Connector>(keystoreFile,keystorePass,keystoreType,truststoreFile,truststorePass,sslProtocol,sslEnabledProtocols,ciphers,clientAuth). Those must now live in a nested<SSLHostConfig>/<Certificate>element.Without this change, every one of those attributes silently fails to set (
SetPropertiesRuledigester warnings), noSSLHostConfiggets created, and the connector fails to initialize:...so candlepin never listens on its HTTPS port. This broke the
candlepin-5.0-rpm-pipelineJenkins job for bothalmalinux10andcentos10-stream(seespec/acceptance/basic_candlepin_spec.rbfailures: port 8443 not listening,curlreturning000, and the nmap TLS checks failing since nothing was listening).Fix
templates/tomcat/server.xml.epp: move the SSL config into a nested<SSLHostConfig>(with<Certificate>for the keystore), translatingclientAuth="want"to the moderncertificateVerification="optional"equivalent, and fixingtruststorePass→truststorePassword(the old name is not a validSSLHostConfigattribute — using it left the truststore password unset, which silently produced zero usable CA certs and failed withthe trustAnchors parameter must be non-emptyeven after theSSLHostConfigwas correctly recognized).spec/classes/candlepin_spec.rb: updated the two assertions that checked for the old flatkeystorePass/sslProtocolattributes to match the new nested structure.<SSLHostConfig>has been supported since Tomcat 8.5, so this isn't an EL10-only syntax — it works on EL9's Tomcat 9.x too.Test plan
Reproduced and fixed locally using forklift's real acceptance pipeline (
pipelines/candlepin.yml), pointed at this branch:pipeline_version=5.0 pipeline_os=centos10-stream(Tomcat 10.1, the originally failing case) — fullbundle exec rake beakerrun passes,failed=0.pipeline_version=4.8 pipeline_os=centos9-stream(Tomcat 9.x, what's actually used in the current 4.8 pipeline) — confirmed no regression,failed=0.🤖 Generated with Claude Code