Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14070

netty4-http - Server Name Indication (SNI) Support

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0, 2.25.0
    • camel-netty4-http
    • None
    • Unknown

    Description

      Implement Server Name Indication (SNI) support for the netty4-http client.

      (Has been solved for HttpClient for many years https://issues.apache.org/jira/browse/HTTPCLIENT-1119)

      This could be implemented in the HttpClientInitializerFactory.configureClientSSLOnDemand like this:

      private SslHandler configureClientSSLOnDemand() throws Exception {
              if (!producer.getConfiguration().isSsl()) {
                  return null;
              }        if (producer.getConfiguration().getSslHandler() != null) {
                  return producer.getConfiguration().getSslHandler();
              } else if (sslContext != null) {
                  URI uri = new URI(nettyProducer.getEndpoint().getEndpointUri());
                  SSLEngine sllEngine = sslContext.createSSLEngine(uri.getHost(), uri.getPort());
                  sllEngine.setUseClientMode(true);
                  SSLParameters sslParameters = sllEngine.getSSLParameters();
                  sslParameters.setServerNames(Arrays.asList(new SNIHostName(uri.getHost())));
                  sllEngine.setSSLParameters(sslParameters);
                  if (producer.getConfiguration().getSslContextParameters() == null) {
                      // just set the enabledProtocols if the SslContextParameter doesn't set
                      engine.setEnabledProtocols(producer.getConfiguration().getEnabledProtocols().split(","));
                  }
                  return new SslHandler(engine);
              }        return null;
          }
      

      Attachments

        Activity

          People

            zhfeng Zheng Feng
            urken Göran Erkstam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m