切勿在生产中使用此TrustManagerFactory。它仅用于测试目的,因此非常不安全。
@Beanpublic WebClient createWebClient() throws SSLException { SslContext sslContext = SslContextBuilder .forClient() .trustManager(InsecureTrustManagerFactory.INSTANCE) .build(); ClientHttpConnector httpConnector = HttpClient.create().secure { t -> t.sslContext(sslContext) } return WebClient.builder().clientConnector(httpConnector).build();}


