Add SSL bundle support to WebClient auto-configuration

Introduce `WebClientSsl` interface and auto-configuration to allow a
WebClient builder to have custom SSL configuration applied.

The previous `ClientHttpConnectorConfiguration` has been been changed
to now create `ClientHttpConnectorFactory` instances which can be used
directly or by `AutoConfiguredWebClientSsl`.

Closes gh-18556
This commit is contained in:
Phillip Webb
2023-04-21 10:06:52 -07:00
parent c59c8cc674
commit 6ea2547de4
22 changed files with 893 additions and 65 deletions

View File

@@ -90,3 +90,16 @@ To make an application-wide, additive customization to all `WebClient.Builder` i
Finally, you can fall back to the original API and use `WebClient.create()`.
In that case, no auto-configuration or `WebClientCustomizer` is applied.
[[io.rest-client.webclient.ssl]]
==== WebClient SSL Support
If you need custom SSL configuration on the `ClientHttpConnector` used by the `WebClient`, you can inject a `WebClientSsl` instance that can be used with the builder's `apply` method.
The `WebClientSsl` interface provides access to any <<features#features.ssl.bundles,SSL bundles>> that you have defined in your `application.properties` or `application.yaml` file.
The following code shows a typical example:
include::code:MyService[]