同时解决Https的SSL证书验证问题和feign不支持Patch请求方法的问题 import  javax. net. ssl.  * ; 
import  java. security.  KeyManagementException ; 
import  java. security.  NoSuchAlgorithmException ; 
import  java. security.  SecureRandom ; 
import  java. security. cert.  X509Certificate ; 
public  class  OkHttpUtils  { public  static  final  X509TrustManager  IGNORE_SSL_TRUST_MANAGER_X509  =  new  X509TrustManager ( )  { @Override public  void  checkClientTrusted ( X509Certificate [ ]  chain,  String  authType)  { } @Override public  void  checkServerTrusted ( X509Certificate [ ]  chain,  String  authType)  { } @Override public  X509Certificate [ ]  getAcceptedIssuers ( )  { return  new  X509Certificate [ ] { } ; } } ; public  static  SSLContext  getIgnoreInitedSslContext ( )  throws  NoSuchAlgorithmException ,  KeyManagementException  { SSLContext  sslContext =  SSLContext . getInstance ( "SSL" ) ; sslContext. init ( null ,  new  TrustManager [ ] { IGNORE_SSL_TRUST_MANAGER_X509 } ,  new  SecureRandom ( ) ) ; return  sslContext; } public  static  HostnameVerifier  getIgnoreSslHostnameVerifier ( )  { return  new  HostnameVerifier ( )  { @Override public  boolean  verify ( String  arg0,  SSLSession  arg1)  { return  true ; } } ; } 
} 
import  feign.  Client ; 
import  feign. okhttp.  OkHttpClient ; 
import  lombok. extern. slf4j.  Slf4j ; 
import  org. springframework. cloud. netflix. ribbon.  SpringClientFactory ; 
import  org. springframework. cloud. openfeign. ribbon.  CachingSpringLoadBalancerFactory ; 
import  org. springframework. cloud. openfeign. ribbon.  LoadBalancerFeignClient ; 
import  org. springframework. context. annotation.  Bean ; 
import  org. springframework. context. annotation.  Configuration ; import  java. security.  KeyManagementException ; 
import  java. security.  KeyStoreException ; 
import  java. security.  NoSuchAlgorithmException ; @Slf4j 
@Configuration 
public  class  FeignConfiguration  { @Bean public  Client  feignClient ( CachingSpringLoadBalancerFactory  cachingFactory,  SpringClientFactory  clientFactory)  throws  NoSuchAlgorithmException ,  KeyStoreException ,  KeyManagementException  { return  new  LoadBalancerFeignClient ( new  OkHttpClient ( new  okhttp3.  OkHttpClient( ) . newBuilder ( ) . sslSocketFactory ( OkHttpUtils . getIgnoreInitedSslContext ( ) . getSocketFactory ( ) ,  OkHttpUtils . IGNORE_SSL_TRUST_MANAGER_X509 ) . hostnameVerifier ( OkHttpUtils . getIgnoreSslHostnameVerifier ( ) ) . build ( ) ) , cachingFactory,  clientFactory) ; } 
}