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

Netty - SSLContext should be initialized once and reused - Also race condition in current code

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.12.1
    • Fix Version/s: 2.12.2, 2.13.0
    • Component/s: camel-netty
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      The SSLContext is created per pipeline which is not as efficient as creating it once.

      Also there is a race condition in the current code that can lead to:

      14:04:27,328 | WARN | ttyServerTCPBoss | netty | 246 - org.jboss.netty - 3.6.6.Final | [org.jboss.netty.channel.socket.nio.AbstractNioSelector] Failed to initialize an accepted socket.
      java.lang.IllegalStateException: SSLContextImpl is not initialized
      at sun.security.ssl.SSLContextImpl.engineCreateSSLEngine(SSLContextImpl.java:197)[:1.7.0_21]
      at javax.net.ssl.SSLContext.createSSLEngine(SSLContext.java:330)
      at org.apache.camel.component.netty.ssl.SSLEngineFactory.createServerSSLEngine(SSLEngineFactory.java:104)
      at org.apache.camel.component.netty.http.HttpServerPipelineFactory.configureServerSSLOnDemand(HttpServerPipelineFactory.java:153)
      at org.apache.camel.component.netty.http.HttpServerPipelineFactory.getPipeline(HttpServerPipelineFactory.java:77)
      

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              davsclaus Claus Ibsen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: