Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Spring RestTemplate HTTPS Connection Disable Certificate Validation (If possible for a given domain)
- <bean id="httpClient" class="org.apache.commons.httpclient.HttpClient">
- <constructor-arg ref="httpClientParams"/>
- <property name="state" ref="httpState"/>
- </bean>
- <bean id="httpClientParams" class="org.apache.commons.httpclient.params.HttpClientParams">
- <property name="authenticationPreemptive" value="true"/>
- <property name="connectionManagerClass"
- value="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager"/>
- </bean>
- <bean id="httpState" class="com.zz.tt.aa.CustomHttpState">
- <property name="credentials" ref="credentials"/>
- </bean>
- <bean id="credentials" class="org.apache.commons.httpclient.UsernamePasswordCredentials">
- <constructor-arg value="XXX"/>
- <constructor-arg value="YYY"/>
- </bean>
- <bean id="httpClientFactory" class="org.springframework.http.client.CommonsClientHttpRequestFactory">
- <constructor-arg ref="httpClient"/>
- </bean>
- <bean class="org.springframework.web.client.RestTemplate">
- <constructor-arg ref="httpClientFactory"/>
- </bean>
Add Comment
Please, Sign In to add comment