Class CommonWebClientSslUtils
java.lang.Object
com.broadleafcommerce.common.extension.webclient.autoconfigure.CommonWebClientSslUtils
Common utility class used to configure Reactor Netty HTTP clients and connectors.
- Since:
- MicroExtensionCommon 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.http.client.reactive.ClientHttpConnectorgetCustomSSLClientConnector(reactor.netty.http.client.HttpClient httpClient, Consumer<io.netty.handler.ssl.SslContextBuilder> sslContextBuilderCustomizer) Returns a NettyClientHttpConnectorconfigured with the providedHttpClient, the custom SSL configuration applied via the customizer, and a custom-built SSL context.static org.springframework.http.client.reactive.ClientHttpConnectorgetDisabledSSLClientConnector(reactor.netty.http.client.HttpClient httpClient, Consumer<io.netty.handler.ssl.SslContextBuilder> sslContextBuilderCustomizer) Returns a NettyClientHttpConnectorconfigured with the providedHttpClient, SSL verification disabled, and optional customizer for theSslContextBuilder.
-
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 NettyClientHttpConnectorconfigured with the providedHttpClient, SSL verification disabled, and optional customizer for theSslContextBuilder.- Parameters:
httpClient- the baseline Netty HttpClient to securesslContextBuilderCustomizer- an optional customizer to apply additional configurations to theSslContextBuilderprior to building the SSL context- Returns:
- a
ClientHttpConnectorwrapping 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 NettyClientHttpConnectorconfigured with the providedHttpClient, 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 securesslContextBuilderCustomizer- a customizer used to build the customSslContext- Returns:
- a
ClientHttpConnectorwrapping the customized, SSL-configured HttpClient - Throws:
SSLException- if the SSL context cannot be initialized
-