2

I have a spring boot app with zuul and ribbon (no eureka) and I need to forward all traffic over https with mutual tls. The keystore and password are all automatically generated by an internal framework. At the end I end up with an SSLContext spring bean which I would like ribbon to use when forwarding zuul requests. Now my question is how do I force ribbon to use my SSLContext?

Thanks in advance!

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
bjoern
  • 1,009
  • 3
  • 15
  • 31

1 Answers1

2

I figured it out. You need to register your own SSLSocketFactory and initialize it with your own SSLContext. Then set the ribbon property ribbon.CustomSSLSocketFactoryClassName: full-path-to-your-CustomSslSocketFactory

public class CustomSslSocketFactory extends SSLSocketFactory {
    public CustomSslSocketFactory() throws Exception {
        super(SSLContextConfig.createSSLContext());
    }
}
bjoern
  • 1,009
  • 3
  • 15
  • 31
  • hi @bjoern, would you mind sharing your application.properties or application.yml to establish how did you configure ribbon, please? I have used your method, without any luck. I have to add that I am attempting mutual authentication via SSL – diginoise Jun 06 '17 at 15:05