You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Andrew Lawrenson <an...@pumpco.co.uk> on 2012/08/14 10:11:42 UTC
Mina2Consumer & SSL
Hi all,
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.
many thanks in advance,
Andrew Lawrenson
--
View this message in context: http://camel.465427.n5.nabble.com/Mina2Consumer-SSL-tp5717295.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: Mina2Consumer & SSL
Posted by Andrew Lawrenson <an...@pumpco.co.uk>.
I've created a JIRA issue for this:
https://issues.apache.org/jira/browse/CAMEL-5537
The older Mina (v1) consumer looks sufficiently different that I'm not sure
whether it suffers from the same issue or not.
many thanks,
Andrew Lawrenson
--
View this message in context: http://camel.465427.n5.nabble.com/Mina2Consumer-SSL-tp5717295p5717933.html
Sent from the Camel Development mailing list archive at Nabble.com.
Re: Mina2Consumer & SSL
Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Aug 14, 2012 at 10:11 AM, Andrew Lawrenson
<an...@pumpco.co.uk> wrote:
> Hi all,
>
>
> 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.
>
Yeah that seems like a good finding. Do you mind creating a JIRA ticket?
And as we love contributions, then patches is welcome.
http://camel.apache.org/contributing.html
And btw I wonder if this would be a problem in the old Mina 1.x
component as well camel-mina?
And as well in camel-netty? Although its a different network library,
its similar to Apache Mina.
> many thanks in advance,
>
> Andrew Lawrenson
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Mina2Consumer-SSL-tp5717295.html
> Sent from the Camel Development mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen