Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
Last active November 27, 2023 02:54
Show Gist options
  • Save sandipchitale/42be354b98a531a49dfda3d6dcd3ff62 to your computer and use it in GitHub Desktop.
Save sandipchitale/42be354b98a531a49dfda3d6dcd3ff62 to your computer and use it in GitHub Desktop.
SslBundles #https #ssl #sslbundles
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
import io.netty.handler.ssl.util.KeyManagerFactoryWrapper;
import javax.net.ssl.KeyManager;
SslManagerBundle insecureSslManagerBundle = SslManagerBundle.of(
new KeyManagerFactoryWrapper(new KeyManager() {}),
InsecureTrustManagerFactory.INSTANCE);
insecureSslBundle = SslBundle.of(null,
null,
null,
null,
insecureSslManagerBundle);
WebClient webClient = WebClient.builder()
.apply(webClientSsl.fromBundle(insecureSslBundle))
.build();
spring:
ssl:
bundle:
jks:
cacerts:
truststore:
type: PKCS12
location: "${java.home}/lib/security/cacerts"
password: changeit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment