Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update chooseEngineClientAlias() to iterating through keyTypes. #30278

Open
wants to merge 1 commit into
base: integration
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/WSX509KeyManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2015 IBM Corporation and others.
* Copyright (c) 2005, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -343,18 +343,26 @@ public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSL
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "chooseEngineClientAlias", new Object[] { keyType, issuers, engine });

String rc = null;
String alias = null;
if (null != customKM && customKM instanceof X509ExtendedKeyManager) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "chooseEngineClientAlias, using customKM -> " + customKM.getClass().getName());
rc = ((X509ExtendedKeyManager) customKM).chooseEngineClientAlias(keyType, issuers, engine);
} else {
rc = chooseClientAlias(keyType[0], issuers);
}
alias = ((X509ExtendedKeyManager) customKM).chooseEngineClientAlias(keyType, issuers, engine);
}
//Despite the Javadoc indicating support for passing an array of keyTypes,
//there is a historical requirement to pass the key individually each time.
//To maintain the zero-migration policy approach, iteration will continue
//unless a performance issue arises.
for (String type : keyType) {
alias = chooseClientAlias(type, issuers);
if (alias != null) {
break;
}
}

if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "chooseEngineClientAlias");
return rc;
return alias;
}

/**
Expand Down