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

choosing wrong server certificate #49

Open
jamieb22 opened this issue Jul 30, 2018 · 2 comments
Open

choosing wrong server certificate #49

jamieb22 opened this issue Jul 30, 2018 · 2 comments

Comments

@jamieb22
Copy link

jamieb22 commented Jul 30, 2018

I managed to get Wildfly-openssl working, but there were a couple of issues along the way. One such issue is that it chose the wrong server certificate for submission to client. It doesn't appear to call chooseServerAlias(..) method to match the selected alias in the KeyManager. Rather, it just calls keyManager.getServerAliases()..and takes the first alias on the list. This could very well create incompatibilities, esp. in scenarios where multiple certs are installed, some of which are not intended for presentation to the client.

@jaikiran
Copy link
Contributor

jaikiran commented Aug 8, 2018

@jamieb22, I am not an expert in this area, but my reading of the code and the understanding of the getServerAliases and chooseServerAlias API suggests that the current implementation in WildFly OpenSSL will end up using the first in the list of returned aliases. This first one is expected to be the most perfect matched alias, from what I understand of the API. If we do use chooseServerAlias instead, I suspect that too will end up returning this same alias.

Is there some specific scenario where this is returning a wrong/unexpected cert alias?

@jamieb22
Copy link
Author

jamieb22 commented Aug 8, 2018

There is a subtle difference in semantics between getServerAliases() and chooseServerAlias(). getServerAliases() simply returns all matching aliases, chooseServerAlias() asks the KeyManager to actually go ahead and select one for presentation to the client. Likewise, for client.

Our custom KeyManager overrides chooseServerAlias to select desired certificate by alias. To ensure compatibility with Wildfly, we needed to ensure that the first alias returned by getServerAliases() would be desired one. Its not a train smash for us, since this subtle difference is easily accounted for, but the behaviour is different when compared to JSSE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants