Interface RestClientSsl
public interface RestClientSsl
Interface that can be used to
apply SSL configuration
to a RestClient.Builder.
Typically used as follows:
@Bean
public MyBean myBean(RestClient.Builder restClientBuilder, RestClientSsl ssl) {
RestClient restClient = restClientBuilder.apply(ssl.fromBundle("mybundle")).build();
return new MyBean(restClient);
}
NOTE: Applying SSL configuration will replace any previously
configured ClientHttpRequestFactory.
The replacement ClientHttpRequestFactory will apply only configured
ClientHttpRequestFactorySettings and the appropriate SslBundle.
If you need to configure ClientHttpRequestFactory with more than just SSL
consider using a ClientHttpRequestFactoryBuilder.
- Since:
- 3.2.0
-
Method Summary
Modifier and TypeMethodDescriptionConsumer<org.springframework.web.client.RestClient.Builder>fromBundle(String bundleName) Return aConsumerthat will apply SSL configuration for the namedSslBundleto aRestClient.Builder.Consumer<org.springframework.web.client.RestClient.Builder>fromBundle(org.springframework.boot.ssl.SslBundle bundle)
-
Method Details
-
fromBundle
Consumer<org.springframework.web.client.RestClient.Builder> fromBundle(String bundleName) throws org.springframework.boot.ssl.NoSuchSslBundleException Return aConsumerthat will apply SSL configuration for the namedSslBundleto aRestClient.Builder.- Parameters:
bundleName- the name of the SSL bundle to apply- Returns:
- a
Consumerto apply the configuration - Throws:
org.springframework.boot.ssl.NoSuchSslBundleException- if a bundle with the provided name does not exist
-
fromBundle
Consumer<org.springframework.web.client.RestClient.Builder> fromBundle(org.springframework.boot.ssl.SslBundle bundle) - Parameters:
bundle- the SSL bundle to apply- Returns:
- a
Consumerto apply the configuration
-