Spring5 WebClient忽略https证书认证
程序员文章站
2022-05-31 16:12:26
...
public static WebClient createWebClient() {
SslContext sslContext = null;
try {
sslContext = SslContextBuilder
.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.build();
} catch (SSLException e) {
e.printStackTrace();
}
SslContext finalSslContext = sslContext;
ClientHttpConnector httpConnector = new ReactorClientHttpConnector(opt -> {
opt.sslContext(finalSslContext);
});
return WebClient.builder().clientConnector(httpConnector).build();
}
上一篇: joomla组件开发入门教程
推荐阅读
-
【SSL证书行业】HTTPS认证支撑网络安全的防护门!
-
.net core signalR 忽略https 证书
-
PHP Curl https跳过ssl证书认证报错记录及解决
-
【SSL证书行业】HTTPS认证支撑网络安全的防护门!
-
httpclient 忽略https,信任所有证书
-
HTTPS认证二: openssl生成证书及签名
-
探究公钥、私钥、对称加密、非对称加密、hash加密、数字签名、数字证书、CA认证、https它们究竟是什么,它们分别解决了通信过程的哪些问题。
-
httpclient访问需要客户端认证数字证书的https接口的处理方法
-
Spring5 WebClient忽略https证书认证
-
RestTemplate忽略https证书认证