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

Mina2 Consumer doesn't reliably work with SSL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.0
    • 2.10.2, 2.11.0
    • camel-mina2
    • None
    • Unknown

    Description

      I've been trying to write a service using Camel 2.10.0 which uses the mina2 component to expose a service, and which uses SSL, using an endpoint of:

      mina2:tcp://localhost:6500?sync=true&filters=#hl7SslFilterFactory,#hl7CodecFilter&allowDefaultCodec=false

      however, what I found was that the SSL handshake was failing quite often for no apparent reason. Investigating further, it appeared that messages sent during the handshake were being processed out of order - specifically, when the client (which uses a standard java SSLSocket) sent a "TLSv1 Change Cipher Spec" followed by a "TLSv1 Handshake", the "TLSv1 Handshake" was being processed before the "TLSv1 Change Cipher Spec", breaking the process.

      This appears to have been caused because when the the Mina2Consumer configures MINA for tcp (in Mina2Consumer.setupSocketProtocol), it is using a UnorderedThreadPoolExecutor - which allows messages to be processed in any order. Switching this to use a OrderedThreadPoolExecutor instead has fixed the issue.

      May I request that the use of UnorderedThreadPoolExecutor vs OrderedThreadPoolExecutor be configurable via endpoint parameters? (or OrderedThreadPoolExecutor is used when SSL if configured). I'm assuming the reason for the use of UnorderedThreadPoolExecutor is simply for performance.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            andrewlawrenson Andrew Lawrenson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: