Spring5 WebClient忽略https证书认证
程序员文章站
2022-03-04 18:24:58
...
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();
}
推荐阅读
-
iOS之Https自签名证书认证及数据请求的封装原理
-
【SSL证书行业】HTTPS认证支撑网络安全的防护门!
-
.net core signalR 忽略https 证书
-
PHP Curl https跳过ssl证书认证报错记录及解决
-
【SSL证书行业】HTTPS认证支撑网络安全的防护门!
-
httpclient 忽略https,信任所有证书
-
HTTPS认证二: openssl生成证书及签名
-
探究公钥、私钥、对称加密、非对称加密、hash加密、数字签名、数字证书、CA认证、https它们究竟是什么,它们分别解决了通信过程的哪些问题。
-
httpclient访问需要客户端认证数字证书的https接口的处理方法
-
Spring5 WebClient忽略https证书认证