You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Ganesh Bansal <ga...@gmail.com> on 2013/03/07 16:06:35 UTC
How to enable SSL
Hi
I am trying to build an Proxy server which has a support for SSL also. I
used examples given on
http://mina.apache.org/mina-project/xref/org/apache/mina/example/ & was
able to build a proxy server for plain connections without SSL.
But when I am adding a SSLFilter in filter chain, proxy server is not able
to get response back from SSL server.
Can anybody help me how to enable SSL in given proxy sample. Any help will
be highly appreciated.
If required, I can share my sample code also.
Thanks in advance,
Ganesh Bansal
Re: How to enable SSL
Posted by Marc Winoto <ma...@netregistry.net>.
I recently did this using the example in
http://mina.apache.org/mina-project/xref/org/apache/mina/example/echoserver/ssl/
If you download the distribution you will find the same example there along with bogus.cert
<mina>/example/src/main/resources/......./echoserver/ssl/bogus.cert
To test, I literally took the code and dropped it into my project. It worked!
I later modified it a bit for my own needs.
I'm still using Mina 1.1.7 BTW.
On 03/08/2013 02:06 AM, Ganesh Bansal wrote:
> Hi
>
> I am trying to build an Proxy server which has a support for SSL also. I
> used examples given on
> http://mina.apache.org/mina-project/xref/org/apache/mina/example/ & was
> able to build a proxy server for plain connections without SSL.
>
> But when I am adding a SSLFilter in filter chain, proxy server is not able
> to get response back from SSL server.
>
> Can anybody help me how to enable SSL in given proxy sample. Any help will
> be highly appreciated.
>
> If required, I can share my sample code also.
>
>
> Thanks in advance,
> Ganesh Bansal
>
Re: How to enable SSL
Posted by Ganesh Bansal <ga...@gmail.com>.
Hi All
It seems to be working fine by adding sslFilter to connector & further
setting useClientMode = true for this sslFilter.
Thanks to all for sparing time & helping me.
Regards,
Ganesh
On Fri, Mar 8, 2013 at 8:30 PM, Andrew Cagney <ca...@fixmo.com> wrote:
> Are you using openjdk-6? I'm going out on a limb here but if you are
> try a different JVM.
> https://issues.apache.org/jira/browse/DIRMINA-937
>
> On Thu, Mar 7, 2013 at 9:47 PM, Ganesh Bansal <ga...@gmail.com>
> wrote:
> > Hi Lécharny
> >
> > Thanks for your inputs.I tried adding ssl filter in connector as well but
> > with no luck. Still the same behavior. I am attaching updated Main.java
> for
> > your reference.
> >
> > Please let me know if I m missing something further.
> >
> >
> > On Thu, Mar 7, 2013 at 11:10 PM, Emmanuel Lécharny <el...@gmail.com>
> > wrote:
> >>
> >> Le 3/7/13 6:04 PM, Ganesh Bansal a écrit :
> >> > Hi
> >> >
> >> > Thanks for your response. Yes, I am adding SSLFilter in filter chain.
> >> > Please find attached source code for your reference.
> >>
> >> As I said, you should have checked if the SSL filter has been added into
> >> both the Acceptor *and* the connector. Looking at the code, I see that
> >> the SSL Filter has just been added to the Acceptor.
> >>
> >> No question why you can't connect using SSL when the connector is not
> >> capable to hanshake with the server...
> >>
> >> Can you add the SSLFilter into the Connector chain, and see if it's any
> >> better ?
> >> Thanks
> >>
> >> --
> >> Regards,
> >> Cordialement,
> >> Emmanuel Lécharny
> >> www.iktek.com
> >>
> >
>
Re: How to enable SSL
Posted by Andrew Cagney <ca...@fixmo.com>.
Are you using openjdk-6? I'm going out on a limb here but if you are
try a different JVM.
https://issues.apache.org/jira/browse/DIRMINA-937
On Thu, Mar 7, 2013 at 9:47 PM, Ganesh Bansal <ga...@gmail.com> wrote:
> Hi Lécharny
>
> Thanks for your inputs.I tried adding ssl filter in connector as well but
> with no luck. Still the same behavior. I am attaching updated Main.java for
> your reference.
>
> Please let me know if I m missing something further.
>
>
> On Thu, Mar 7, 2013 at 11:10 PM, Emmanuel Lécharny <el...@gmail.com>
> wrote:
>>
>> Le 3/7/13 6:04 PM, Ganesh Bansal a écrit :
>> > Hi
>> >
>> > Thanks for your response. Yes, I am adding SSLFilter in filter chain.
>> > Please find attached source code for your reference.
>>
>> As I said, you should have checked if the SSL filter has been added into
>> both the Acceptor *and* the connector. Looking at the code, I see that
>> the SSL Filter has just been added to the Acceptor.
>>
>> No question why you can't connect using SSL when the connector is not
>> capable to hanshake with the server...
>>
>> Can you add the SSLFilter into the Connector chain, and see if it's any
>> better ?
>> Thanks
>>
>> --
>> Regards,
>> Cordialement,
>> Emmanuel Lécharny
>> www.iktek.com
>>
>
Re: How to enable SSL
Posted by Ganesh Bansal <ga...@gmail.com>.
Hi Lécharny
Thanks for your inputs.I tried adding ssl filter in connector as well but
with no luck. Still the same behavior. I am attaching updated Main.java for
your reference.
Please let me know if I m missing something further.
On Thu, Mar 7, 2013 at 11:10 PM, Emmanuel Lécharny <el...@gmail.com>wrote:
> Le 3/7/13 6:04 PM, Ganesh Bansal a écrit :
> > Hi
> >
> > Thanks for your response. Yes, I am adding SSLFilter in filter chain.
> > Please find attached source code for your reference.
>
> As I said, you should have checked if the SSL filter has been added into
> both the Acceptor *and* the connector. Looking at the code, I see that
> the SSL Filter has just been added to the Acceptor.
>
> No question why you can't connect using SSL when the connector is not
> capable to hanshake with the server...
>
> Can you add the SSLFilter into the Connector chain, and see if it's any
> better ?
> Thanks
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>
Re: How to enable SSL
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 3/7/13 6:04 PM, Ganesh Bansal a écrit :
> Hi
>
> Thanks for your response. Yes, I am adding SSLFilter in filter chain.
> Please find attached source code for your reference.
As I said, you should have checked if the SSL filter has been added into
both the Acceptor *and* the connector. Looking at the code, I see that
the SSL Filter has just been added to the Acceptor.
No question why you can't connect using SSL when the connector is not
capable to hanshake with the server...
Can you add the SSLFilter into the Connector chain, and see if it's any
better ?
Thanks
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: How to enable SSL
Posted by Ganesh Bansal <ga...@gmail.com>.
Hi
Thanks for your response. Yes, I am adding SSLFilter in filter chain.
Please find attached source code for your reference.
Any help in this will be highly appreciated.
Thanks
Ganesh
On Thu, Mar 7, 2013 at 8:52 PM, Emmanuel Lécharny <el...@gmail.com>wrote:
> Le 3/7/13 4:06 PM, Ganesh Bansal a écrit :
> > Hi
> >
> > I am trying to build an Proxy server which has a support for SSL also. I
> > used examples given on
> > http://mina.apache.org/mina-project/xref/org/apache/mina/example/ & was
> > able to build a proxy server for plain connections without SSL.
> >
> > But when I am adding a SSLFilter in filter chain, proxy server is not
> able
> > to get response back from SSL server.
> >
> > Can anybody help me how to enable SSL in given proxy sample. Any help
> will
> > be highly appreciated.
> >
> > If required, I can share my sample code also.
>
> Yes, that would be helpful. Have you injected the SSL Filter in both the
> client and the server ?
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>
>
Re: How to enable SSL
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 3/7/13 4:06 PM, Ganesh Bansal a écrit :
> Hi
>
> I am trying to build an Proxy server which has a support for SSL also. I
> used examples given on
> http://mina.apache.org/mina-project/xref/org/apache/mina/example/ & was
> able to build a proxy server for plain connections without SSL.
>
> But when I am adding a SSLFilter in filter chain, proxy server is not able
> to get response back from SSL server.
>
> Can anybody help me how to enable SSL in given proxy sample. Any help will
> be highly appreciated.
>
> If required, I can share my sample code also.
Yes, that would be helpful. Have you injected the SSL Filter in both the
client and the server ?
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com