public interface WebClientSsl
Interface that can be used to apply SSL configuration to a WebClient.Builder.

Typically used as follows:

 @Bean
 public MyBean myBean(WebClient.Builder webClientBuilder, WebClientSsl ssl) {
     WebClient webClient = webClientBuilder.apply(ssl.forBundle("mybundle")).build();
     return new MyBean(webClient);
 }
 
NOTE: Apply SSL configuration will replace any previously configured ClientHttpConnector.
Since:
3.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Consumer<org.springframework.web.reactive.function.client.WebClient.Builder>
    fromBundle(String bundleName)
    Return a Consumer that will apply SSL configuration for the named SslBundle to a WebClient.Builder.
    Consumer<org.springframework.web.reactive.function.client.WebClient.Builder>
    fromBundle(org.springframework.boot.ssl.SslBundle bundle)
    Return a Consumer that will apply SSL configuration for the SslBundle to a WebClient.Builder.
  • Method Details

    • fromBundle

      Consumer<org.springframework.web.reactive.function.client.WebClient.Builder> fromBundle(String bundleName) throws org.springframework.boot.ssl.NoSuchSslBundleException
      Return a Consumer that will apply SSL configuration for the named SslBundle to a WebClient.Builder.
      Parameters:
      bundleName - the name of the SSL bundle to apply
      Returns:
      a Consumer to apply the configuration
      Throws:
      org.springframework.boot.ssl.NoSuchSslBundleException - if a bundle with the provided name does not exist
    • fromBundle

      Consumer<org.springframework.web.reactive.function.client.WebClient.Builder> fromBundle(org.springframework.boot.ssl.SslBundle bundle)
      Return a Consumer that will apply SSL configuration for the SslBundle to a WebClient.Builder.
      Parameters:
      bundle - the SSL bundle to apply
      Returns:
      a Consumer to apply the configuration