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

HttpClient not initialized correctly in version 2.11 (regression from 2.10.5) #695

Closed
dbahatSAP opened this issue Oct 21, 2021 · 3 comments · Fixed by #698
Closed

HttpClient not initialized correctly in version 2.11 (regression from 2.10.5) #695

dbahatSAP opened this issue Oct 21, 2021 · 3 comments · Fixed by #698
Assignees
Labels
bug Something isn't working

Comments

@dbahatSAP
Copy link

Please first read carefully Report an issue section before creating an Issue.

Issue Summary

  • A clear and concise description of the issue.
    Initializing a spring boot app using version 2.11 fails to correctly initialize the default http client (worked in 2.10.5)
  • Steps to reproduce the problem: 1. 2. 3.
  1. Create a spring boot app that uses xsuaaTokenFlows.clientCredentialsTokenFlow(), using the default http client and auto spring config.
  2. In the app properties set the xsuaa configuration to use x509 certificate authentication.
  3. Start the app (com.sap.cloud.security logs on DEBUG)
  • What is the expected result?
    The x509 certificate should get loaded into the http client during init, and following request to fetching a token should work (worked in version 2.10.5)
  • What happened instead?
    The certificate doesn't appear to get loaded. mTLS during token generation fails due to missing client certificate.
  • Additional information? (attach screenshots if applicable)
    Test app - https://github.wdf.sap.corp/hcp-reporting/metering-demo-app
    Logs:

Version 2.10.5 (worked)
image

Version 2.11 (the issue)
image

@dbahatSAP dbahatSAP added the bug Something isn't working label Oct 21, 2021
@liga-oz liga-oz self-assigned this Oct 21, 2021
@liga-oz
Copy link
Contributor

liga-oz commented Oct 21, 2021

Hi @dbahatSAP,

it seems to choose the non X509 http client because the ClientIdentity class apparently can't find the certificate and key from the XsuaaServiceConfiguration. There is a check that was introduced with 2.11.0 that requires both to be present. Are you using XsuaaServiceConfigurationDefault configuration?

nenaraab pushed a commit that referenced this issue Oct 22, 2021
* revert XsuaaConfigurationDefault changes, add tests, fixes #695

* remove unneeded env variable rule
@nenaraab
Copy link
Contributor

@dbahatSAP
Copy link
Author

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants