feignClient 忽略https请求问题
Posted fqybzhangji
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了feignClient 忽略https请求问题相关的知识,希望对你有一定的参考价值。
@Bean
public Client getClient() throws NoSuchAlgorithmException, KeyManagementException {
SSLContext sslContext = SSLContext.getInstance("tls");
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}
};
sslContext.init(null, trustAllCerts, new SecureRandom());
return new Client.Default(sslContext.getSocketFactory(), null);
}
feignClient 忽略https请求问题
以上是关于feignClient 忽略https请求问题的主要内容,如果未能解决你的问题,请参考以下文章
SpringCloud---FeignClient处理请求超时问题
Spring Cloud Netflix:通过 RequestInterceptor 将主机请求参数传递给 FeignClient