On 29 March 2011 19:31, Rajika Kumarasiri <[email protected]> wrote: > BTW, > I have a one last question on the patch. I have registered SSL protocol > handler as the last handler in the chain where you have registered as the > first ( see below for the diff). Please also refer [0]. And yes I tested > with following changes. > > Rajika > > @@ -363,7 +367,9 @@ > { > if (_sslFactory != null) > { > - > protocolSession.getFilterChain().addBefore("protocolFilter", "sslFilter", > +// > protocolSession.getFilterChain().addBefore("protocolFilter", "sslFilter", > +// new > SSLFilter(_sslFactory.buildServerContext())); > + protocolSession.getFilterChain().addLast("sslFilter", > new SSLFilter(_sslFactory.buildServerContext())); > > > [0] - > http://svn.apache.org/repos/asf/mina/trunk/mina-example/src/main/java/org/apache/mina/example/echoserver/Main.java > > >
To be completely honest on debugging I found that there was only one filter in the chain at the point this code gets called... I just thought that "first" for the SSL filter seemed more sensible that "last" (since you want SSL decrypt before anything else) and so that's what I tried... it worked... and I gave it no more thought :-) -- Rob > > On Tue, Mar 29, 2011 at 10:54 PM, Rajika Kumarasiri <[email protected]>wrote: > >> I tested the patch and now everything works fine. Please go ahead and >> apply the changes, or do you want me to create a JIRA issue to keep track >> this ? >> >> >> Rajika >> >> >> On Tue, Mar 29, 2011 at 4:39 PM, Rajika Kumarasiri <[email protected]>wrote: >> >>> hi Rob, >>> Your second change is the exact change that I did to get the SSL to work. >>> I'll attach your patch and let you know. >>> >>> Thanks! >>> >>> Rajika >>> >>> >>> On Tue, Mar 29, 2011 at 4:34 PM, Robert Godfrey <[email protected] >>> > wrote: >>> >>>> Hi Rajika, >>>> >>>> there's actually two issues which need fixing to get SSL support in the >>>> broker (by coincidence I happened to be looking at this over the weekend) - >>>> and by the looks of the problem you are reporting you've only fixed one of >>>> them... >>>> >>>> try the attached patch for the trunk broker and see if this resolves >>>> your SSL issues >>>> >>>> Cheers, >>>> Rob >>>> >>>> >>>> On 29 March 2011 12:15, Rajika Kumarasiri <[email protected]> wrote: >>>> >>>>> I came across the following NPE, when trying to use the broker against >>>>> a >>>>> client(Publisher.java). The Qpid server is configured for SSL and >>>>> client >>>>> connect using the url: >>>>> >>>>> "amqp://guest:guest@test >>>>> /?brokerlist='tcp://localhost:8672?ssl='true''" >>>>> >>>>> 2011-03-29 15:34:43,478 ERROR [pool-3-thread-1] >>>>> (AMQProtocolEngine.java:258) >>>>> - Unexpected exception when processing datablock >>>>> java.lang.NullPointerException >>>>> at >>>>> >>>>> org.apache.qpid.server.output.ProtocolOutputConverterRegistry.getConverter(ProtocolOutputConverterRegistry.java:59) >>>>> at >>>>> >>>>> org.apache.qpid.server.protocol.AMQProtocolEngine.setProtocolVersion(AMQProtocolEngine.java:889) >>>>> at >>>>> >>>>> org.apache.qpid.server.protocol.AMQProtocolEngine.protocolInitiationReceived(AMQProtocolEngine.java:360) >>>>> at >>>>> >>>>> org.apache.qpid.server.protocol.AMQProtocolEngine.dataBlockReceived(AMQProtocolEngine.java:277) >>>>> at >>>>> >>>>> org.apache.qpid.server.protocol.AMQProtocolEngine$1.run(AMQProtocolEngine.java:254) >>>>> at org.apache.qpid.pool.Job.processAll(Job.java:110) >>>>> at org.apache.qpid.pool.Job.run(Job.java:149) >>>>> at >>>>> >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >>>>> at >>>>> >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >>>>> at java.lang.Thread.run(Thread.java:619) >>>>> >>>>> >>>>> The reason is session.getProtocolVersion() returns 0-10 in >>>>> ProtocolOutputConverterRegistry#getConverter and the lookup returns >>>>> null. >>>>> Because we only register versions 0.8, 0.9 and 0.91 in the static block >>>>> in >>>>> the same class. Is there any reason to left out version 0-10? Also I >>>>> don't >>>>> see any protocol conversion source in the package >>>>> org.apache.qpid.server.output. Is this on purpose or still under >>>>> development >>>>> ? >>>>> >>>>> BTW, I fixed an issue related to broker's SSL support and will attach >>>>> that >>>>> patch soon. >>>>> >>>>> >>>>> Rajika >>>>> >>>> >>>> >>> >> >
