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, RestTemplate is using SimpleClientHttpRequestFactory by 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 with new RestTemplateBuilder.build(). This seems unintentional, especially considering a previous (partial) fix that added some functionality (through useSystemProperties()) 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.

Comment From: pivotal-cla

@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.

Comment From: pivotal-cla

@tomfrenken Thank you for signing the Contributor License Agreement!

Comment From: tomfrenken

Probably worth mentioning that to reproduce this issue, you have to include Apache's HTTP Client (org.apache.hc.client5.http.impl.classic.HttpClients) in your classpath, otherwise, RestTemplateBuilder won't pick up the changes of this PR. :D

Comment From: mhalbritter

Thank you very much and congratulations on your first contribution :tada:!