Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.sis.sismarches.smw.stub.atexo.config;
- import javax.net.ssl.SSLContext;
- import org.apache.http.conn.ssl.NoopHostnameVerifier;
- import org.apache.http.impl.client.CloseableHttpClient;
- import org.apache.http.impl.client.HttpClients;
- import org.apache.http.ssl.SSLContextBuilder;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- /**
- * @author aboubacar.camara
- *
- */
- @Configuration
- public class SisRestClientXmlApiConfig {
- @Bean
- public SSLContext sslContext() throws Exception {
- return new SSLContextBuilder()
- .loadTrustMaterial(null, new SisTrustStrategy())
- .build();
- }
- @Bean(name = "httpClient")
- public CloseableHttpClient httpClient() throws Exception {
- return HttpClients.custom()
- .setSslcontext(sslContext())
- .setSSLHostnameVerifier(new NoopHostnameVerifier())
- .build();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement