System SSL certificates are not used by the Apache HTTP Client in a RestTemplate built with RestTemplateBuilder#38591
Closed
tomfrenken wants to merge 4 commits into
Closed
System SSL certificates are not used by the Apache HTTP Client in a RestTemplate built with RestTemplateBuilder#38591tomfrenken wants to merge 4 commits into
tomfrenken wants to merge 4 commits into
Conversation
|
@tomfrenken Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@tomfrenken Thank you for signing the Contributor License Agreement! |
useSystemProperties() to RestTemplateBuilder to pick up SSL certificates
useSystemProperties() to RestTemplateBuilder to pick up SSL certificatesRestTemplateBuilder
Author
|
Probably worth mentioning that to reproduce this issue, you have to include Apache's HTTP Client ( |
RestTemplateBuilder
Contributor
|
Thank you very much and congratulations on your first contribution 🎉! |
mhalbritter
pushed a commit
that referenced
this pull request
Nov 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
With this change, the SSL certificates that are provided by the system are picked up by default when using the
RestTemplateBuilder.This aligns with the implementation of
new RestTemplate()which is already doing this, and can be considered a follow-up to a previous (partial) fix from 5 months ago relating to this issue.(For context,
RestTemplateis usingSimpleClientHttpRequestFactoryby default, which appears to be picking up the SSL certificates from the environment)In our Cloud Foundry environment, where the SSL certificates are provided by the system through a build-pack, we encountered a problem with SSL certificates. The SSL certificates from the system work fine with
new RestTemplate(), but not withnew RestTemplateBuilder.build(). This seems unintentional, especially considering a previous (partial) fix that added some functionality (throughuseSystemProperties()) but missed the SSL properties.As I am quite new to the Java & Spring Boot ecosystem I am not entirely sure how to best test this, but the issue we are facing seems to be a spring-boot issue to me, which can hopefully be fixed with my PR.