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

Relaxed SSL validation with RestTemplate interceptors #1869

Merged
merged 3 commits into from
Mar 21, 2023

Conversation

nkolosnjaji
Copy link
Contributor

@nkolosnjaji nkolosnjaji commented Feb 12, 2023

  • Added test with Apache client and HTTPS
  • Added test with Apache client and HTTPS and additional interceptor (original issue)
  • Implementation is done with ReflectionUtils :( as I was not able to find better way (InterceptingClientHttpRequestFactory expose only "createRequest")

closes #1868

factory.setHttpClient(createSslHttpClient());
}
else if (restTemplate.getRequestFactory() instanceof InterceptingClientHttpRequestFactory) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other way rather than doing this via reflection? Maybe we should ask the Spring team for relaxing some constraints there if there's no other way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to find better way. I will create ticket in Spring framework

@marcingrzejszczak
Copy link
Contributor

Can you please fix checkstyle issues in the meantime?

@nkolosnjaji
Copy link
Contributor Author

Sorry didn't have time, will do it today.

@nkolosnjaji
Copy link
Contributor Author

done, sorry for delay.

@marcingrzejszczak marcingrzejszczak merged commit 5343cb9 into spring-cloud:main Mar 21, 2023
@marcingrzejszczak
Copy link
Contributor

Thanks @nkolosnjaji !

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

Successfully merging this pull request may close these issues.

AutoConfigureHttpClient RestTemplate with InterceptingClientHttpRequestFactory
3 participants