Feignclient constructs https connection

  springboot, springcloud

IsSecure parameters

This parameter is only useful for services registered in eureka and not for external services using ribbon.listOfServers.

Url designation

The advantage of this method is that it is easy to use and specify directly.

@FeignClient(value = "ssoService",url = "https://sso.xixicat.com")

There is nothing else to configure. The bad thing is that you cannot use the client polling of the ribbon and need to configure ngxix load balancing in the domain name of the url.


If you use this, you need to construct your own https connection.

public Client feignClient(CachingSpringLoadBalancerFactory cachingFactory,
        SpringClientFactory clientFactory) {
    return new LoadBalancerFeignClient(new Client.Default(getTrustedSSLSocketFactory(), new HostnameVerifier(){}),
            cachingFactory, clientFactory);