title: Feign client SSL Config with jks
body: <p>I tried the below code to setup my SSL Config for feign client. But somehow keep getting this error. Could you please help?
  400 Bad Request
  No required SSL certificate was sent</p>
  <pre><code>@Configuration
  public class FeignClientConfig {
  
      @Value(&quot;${keystore.path}&quot;)
  
      private String keystorePath;
  
      @Value(&quot;${keystore.type}&quot;)
      private String keystoreType;
      @Value(&quot;${keystore.password}&quot;)
      private String keystorePassword;
  
      @Bean
      public void Config() {
          System.setProperty(&quot;javax.net.ssl.keyStoreType&quot;, keystoreType);
          System.setProperty(&quot;javax.net.ssl.keyStore&quot;, keystorePath);
          System.setProperty(&quot;javax.net.ssl.keyStorePassword&quot;, keystorePassword);
      }
  
      @Bean
      public Client feignClient() {
          Client trustSSLSockets = new Client.Default(getSSLSocketFactory(), new NoopHostnameVerifier());
          System.out.print(&quot;feignClient called&quot;);
          return trustSSLSockets;
      }
  
      @Bean
      @ConditionalOnMissingBean
      public Feign.Builder feignBuilder(Retryer retryer) {
          return Feign.builder().retryer(retryer);
      }
  
      @Bean
      public Feign.Builder feignBuilder() {
          return Feign.builder()
                  .retryer(Retryer.NEVER_RETRY)
                  .client(new Client.Default(getSSLSocketFactory(), null));
      }
  
      private SSLSocketFactory getSSLSocketFactory() {
          char[] allPassword = keystorePassword.toCharArray();
          SSLContext sslContext = null;
          try {
              sslContext = SSLContextBuilder
                      .create()
                      .setKeyStoreType(keystoreType)
                      .loadKeyMaterial(ResourceUtils.getFile(keystorePath), allPassword,allPassword)
                      .build();
          } catch (Exception e) {
          }
          return sslContext.getSocketFactory();
      }
  }
  </code></pre>