java.lang.Object
com.broadleafcommerce.common.extension.webclient.autoconfigure.CommonWebClientSslUtils

public class CommonWebClientSslUtils extends Object
Common utility class used to configure Reactor Netty HTTP clients and connectors.
Since:
MicroExtensionCommon 3.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.http.client.reactive.ClientHttpConnector
    getCustomSSLClientConnector(reactor.netty.http.client.HttpClient httpClient, Consumer<io.netty.handler.ssl.SslContextBuilder> sslContextBuilderCustomizer)
    Returns a Netty ClientHttpConnector configured with the provided HttpClient, the custom SSL configuration applied via the customizer, and a custom-built SSL context.
    static org.springframework.http.client.reactive.ClientHttpConnector
    getDisabledSSLClientConnector(reactor.netty.http.client.HttpClient httpClient, Consumer<io.netty.handler.ssl.SslContextBuilder> sslContextBuilderCustomizer)
    Returns a Netty ClientHttpConnector configured with the provided HttpClient, SSL verification disabled, and optional customizer for the SslContextBuilder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CommonWebClientSslUtils

      public CommonWebClientSslUtils()
  • Method Details

    • getDisabledSSLClientConnector

      public static org.springframework.http.client.reactive.ClientHttpConnector getDisabledSSLClientConnector(reactor.netty.http.client.HttpClient httpClient, @Nullable Consumer<io.netty.handler.ssl.SslContextBuilder> sslContextBuilderCustomizer) throws SSLException
      Returns a Netty ClientHttpConnector configured with the provided HttpClient, SSL verification disabled, and optional customizer for the SslContextBuilder.
      Parameters:
      httpClient - the baseline Netty HttpClient to secure
      sslContextBuilderCustomizer - an optional customizer to apply additional configurations to the SslContextBuilder prior to building the SSL context
      Returns:
      a ClientHttpConnector wrapping the customized, SSL-configured HttpClient
      Throws:
      SSLException - if the SSL context cannot be initialized
    • getCustomSSLClientConnector

      public static org.springframework.http.client.reactive.ClientHttpConnector getCustomSSLClientConnector(reactor.netty.http.client.HttpClient httpClient, Consumer<io.netty.handler.ssl.SslContextBuilder> sslContextBuilderCustomizer) throws SSLException
      Returns a Netty ClientHttpConnector configured with the provided HttpClient, the custom SSL configuration applied via the customizer, and a custom-built SSL context.

      Used to configure custom SSL contexts (such as mTLS, custom trust stores, or specific CAs).

      Parameters:
      httpClient - the baseline Netty HttpClient to secure
      sslContextBuilderCustomizer - a customizer used to build the custom SslContext
      Returns:
      a ClientHttpConnector wrapping the customized, SSL-configured HttpClient
      Throws:
      SSLException - if the SSL context cannot be initialized