Greetings. I faced with next issue : I use spring 3.1.4 with feign
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>4.0.4</version>
I have multiply feign clients. These clients work by https . So I created bean Feign.Builder something like this pseudocode:
@Bean
public Feign.Builder feignBuilder() {
HostnameVerifier hostnameVerifier = (hostname, session) -> true;
return Feign.builder()
.client(new Client.Default(createSocketFactory(), hostnameVerifier));
}
Next moment is interceptor. I have interceptor
public class FooConfiguration {
@Bean
public RequestInterceptor fooInterceptor( {
... pseudocode
return interceptor;
}
}
finally feign client is
@FeignClient(name = "foo-client", url = "${foo-client.url}", configuration = FooConfiguration.class)
public interface FooFeignClient {
@PostMapping("/foo")
Dto findFoo(@RequestBody FooDto fooDto);
}
Problem is interceptor does not work and interceptor was not called. It seems like configuration is not applied when I use client with SSL.
P.S. Also, I tested it WITHOUT SSL -when I DONT USE Feign.Builder feignBuilder() it works correctly and Interceptor was triggered in SPRING BOOT 3.1.4. Also I tested it WITH SSL when I USE Feign.Builder feignBuilder() it works correctly and Interceptor was triggered in SPRING BOOT 2.7
Interceptor does not work via feign configuration in spring boot 3.1.4 with SSL.
Comment From: wilkinsona
Spring Boot doesn't know anything about Feign or Spring Cloud's support for it. In the first instance, I think this should be investigated as a Spring Cloud OpenFeign issue.