Fixes for SSLEngine.setWant/NeedClientAuth() and choosing key alias chooseEngineClient/ServerAlias() #172
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 makes fixes around how a server-side SSLEngine handles client authentication, as well as how wolfJSSE calls X509KeyManager/X509ExtendedKeyManager objects to choose a private key alias to be used to load the client/server private key:
WolfSSLEngine
setWantClientAuth(true)
was previously too restrictive whensetNeedClientAuth(false)
. This meant that when a server application requested client authentication, but instructed the JSSE layer to not to be a failure if the client did not send a certificate (ie withsetWantClientAuth(true)
, we were requiring the client send a certificate and would error out. This PR loosens that requirement to match expected behavior withsetWantClientAuth()
.X509ExtendedKeyManager
, which has two new methods for selecting the key alias to be used for loading the client/server private key (chooseEngineClientAlias()
,chooseEngineServerAlias()
). This PR finishes that support by calling the correct alias selector method where appropriate. Since some of these methods accept aSocket
orSSLEngine
as parameter, loading of the private key has been delayed fromSSLContext
creation later to when theSSLSocket
orSSLEngine
is created.ZD 17248