-
Notifications
You must be signed in to change notification settings - Fork 41.1k
AutoConfiguredRestClientSsl overwrites configuration from HttpClientProperties #43618
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
Comments
I think this is working as documented: Lines 38 to 42 in 15b63fa
|
This note and also the corresponding sentences in the reference docs don't really tell me that this affects the I'm aware that the Boot team is aware of these configuration limitations, and I'm seeing my issue here as another one of those. If you disagree, then I'd say that this is a documentation issue. Maybe you could consider adding warning boxes to the documentation sections where the HTTP properties and SSL configuration are described, warning users that the properties are ignored if certain other beans are defined. |
This is similar to #36594 and #27360 but I'm not sure if a solution for those issues would also fix mine, so feel free to close this if you consider this to be a duplicate.
Issue: Configuration made through the
spring.http.client
properties is ignored if I useAutoConfiguredRestClientSsl
. For example, configuration likedoes not work if I also have this:
The reason for this is that
AutoConfiguredRestClientSsl
replaces the request factory and thus discards any configuration made via thespring.http.client
properties:spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/client/AutoConfiguredRestClientSsl.java
Lines 52 to 56 in 1832852
For this specific issue I can work around this by removing my
RestClientCustomizer
and useinstead, but this only works in this static scenario, if I needed some more sophisticated logic to determine the SSL bundle to use at runtime, this wouldn't work.
The text was updated successfully, but these errors were encountered: