-
Feign Client Except SSL개발 2021. 2. 9. 15:03
@Bean public Client feignClient() { Client trustSSLSockets = new Client.Default(getSSLSocketFactory(), new NoopHostnameVerifier()); log.info("feignClient called"); return trustSSLSockets; } private SSLSocketFactory getSSLSocketFactory() { try { TrustStrategy acceptingTrustStrategy = new TrustStrategy() { @Override public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { //Do your validations return true; } }; SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build(); return sslContext.getSocketFactory(); } catch (Exception exception) { throw new RuntimeException(exception); } }
출처: stack
'개발' 카테고리의 다른 글
git info (0) 2023.03.22 Spring Cloud Config 설정 파일 변경 (0) 2023.02.16 mysqlclient 1.4.0 or newer is required; you have 0.10.0 (0) 2020.08.26 IoT (Internet of Things), ICT (Information & Communication Technology) (0) 2020.08.13 JSP 에서 환경설정 값 사용하기 (0) 2020.06.29