Fix SSL configuration selection for multiple outbound connections with different certificates#35132
Open
una-tapa wants to merge 1 commit into
Open
Conversation
…h different certificates This fix addresses issue OpenLiberty#34391 where multiple outbound connections with different clientCertificate attributes were incorrectly accumulating certificate aliases (e.g., 'sslConfigId:cert1:cert2:cert3') instead of maintaining separate aliases for each connection (e.g., 'sslConfigId:cert1', 'sslConfigId:cert2'). The root cause was that the sslCfgAlias parameter was being modified directly in the loop, causing subsequent iterations to append to the already-modified value. Changes: - Introduced a local variable 'currentSslCfgAlias' to avoid modifying the original sslCfgAlias parameter - Removed unnecessary special check for host '*' and port '*' - Updated debug trace message for clarity - Added comprehensive unit tests to verify the fix Ported from: https://github.ibm.com/websphere/open-liberty-service/pull/1741
Member
Author
|
!build (view Open Liberty Personal Build - ❌ completed with errors/failures.) Note: Target locations of links might be accessible only to IBM employees. |
Member
Code analysis and actionsDO NOT DELETE THIS COMMENT.
|
Member
|
The following files contain comments noting GenAI assistance:
|
1 similar comment
Member
|
The following files contain comments noting GenAI assistance:
|
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.
This PR fixes issue #34391 where multiple outbound connections with different clientCertificate attributes were incorrectly accumulating certificate aliases.
Problem
When configuring multiple
<outboundConnection>entries with differentclientCertificateattributes, the SSL configuration alias was being accumulated across iterations (e.g.,sslConfigId:cert1:cert2:cert3) instead of maintaining separate aliases for each connection (e.g.,sslConfigId:cert1,sslConfigId:cert2).Root Cause
The
sslCfgAliasparameter was being modified directly in the loop, causing subsequent iterations to append to the already-modified value.Solution
currentSslCfgAliasto avoid modifying the originalsslCfgAliasparameter*and port*Testing
Added
OutboundSSLSelectionsTest.javawith 7 test cases covering:Fixes: #34391