You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Christian Bourque <ch...@gmail.com> on 2009/02/24 20:04:11 UTC
EJBd protocol over SSL
Hi,
What is the correct way of using ejbd over ssl?
I've tried setting this property on the server side:
properties.setProperty("ejbd.secure", "true");
But is there something specific to set on the client side?
I always end up getting this error: "javax.net.ssl.SSLException:
Unrecognized SSL message, plaintext connection?"...
BTW I'm running in embedded mode with remoting...
Regards,
Christian
Re: EJBd protocol over SSL
Posted by Jonathan Gallimore <jo...@gmail.com>.
I think David might have made a change in this regard after Christian's
post - I noticed this diff:
Author: dblevins
Date: Tue Feb 24 20:02:36 2009
New Revision: 747532
URL: http://svn.apache.org/viewvc?rev=747532&view=rev
Log:
ejbds should be enabled
Modified:
openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java
Modified: openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java?rev=747532&r1=747531&r2=747532&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java (original)
+++ openejb/trunk/openejb3/server/openejb-client/src/main/java/org/apache/openejb/client/ConnectionManager.java Tue Feb 24 20:02:36 2009
@@ -29,6 +29,7 @@
factories.register("default", ejbdFactory);
factories.register("ejbd", ejbdFactory);
+ factories.register("ejbds", ejbdFactory);
HttpConnectionFactory httpFactory = new HttpConnectionFactory();
factories.register("http", httpFactory);
Jon
Jean-Sébastien Scrève wrote:
> Hi Christian,
>
> I'd say it's a bug.
>
> To connect, I had to set "ejbds" protocol and change openEJB code.
>
> Here is what I did to connect to the server :
>
> Properties prop = new Properties();
> prop.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.RemoteInitialContextFactory");
> prop.put("java.naming.provider.url", "ejbds://127.0.0.1:4201");
> prop.put("ejbd.secure", "true");
> Context myContext = new InitialContext(prop);
>
> I patched org.apache.openejb.client.ConnectionManager to let openEJB
> recognize ejbds protocol.
>
> It's not my area of expertise so is it correct to set ejbds protocol ?
>
> If so, I can create a JIRA and submit the patch.
>
> Regards,
>
> Jean-Sébastien Scrève.
>
>
> Christian Bourque wrote:
>
>> Hi,
>>
>> What is the correct way of using ejbd over ssl?
>>
>> I've tried setting this property on the server side:
>>
>> properties.setProperty("ejbd.secure", "true");
>>
>> But is there something specific to set on the client side?
>>
>> I always end up getting this error: "javax.net.ssl.SSLException:
>> Unrecognized SSL message, plaintext connection?"...
>>
>> BTW I'm running in embedded mode with remoting...
>>
>> Regards,
>>
>> Christian
>>
>>
>>
>
>
Re: EJBd protocol over SSL
Posted by Christian Bourque <ch...@gmail.com>.
Hi Guys,
Indeed after a chat with David on IRC with realised that the ejbds protocol
was simply not registered in ConnectionManager... So he suggested two
methods (as he posted earlier) to register the protocol at runtime and both
are working perfectly!
Thanks again David! I owe you a beer :)
Christian
On Thu, Feb 26, 2009 at 12:21 PM, David Blevins <da...@visi.com>wrote:
>
> On Feb 26, 2009, at 9:03 AM, Jean-Sébastien Scrève wrote:
>
>
>> Hi Christian,
>>
>> I'd say it's a bug.
>>
>> To connect, I had to set "ejbds" protocol and change openEJB code.
>>
>> Here is what I did to connect to the server :
>>
>> Properties prop = new Properties();
>> prop.put(Context.INITIAL_CONTEXT_FACTORY,
>> "org.apache.openejb.client.RemoteInitialContextFactory");
>> prop.put("java.naming.provider.url", "ejbds://127.0.0.1:4201");
>> prop.put("ejbd.secure", "true");
>> Context myContext = new InitialContext(prop);
>>
>> I patched org.apache.openejb.client.ConnectionManager to let openEJB
>> recognize ejbds protocol.
>>
>> It's not my area of expertise so is it correct to set ejbds protocol ?
>>
>
> That's correct. This person pinged me on irc about an hour after this post
> and we got it worked out. I was just thinking to write a followup to the
> list, but you beat me to it :)
>
> As a note to any archive readers. For those that want to use SSL over EJBd
> in 3.1 can do one :
>
> 1) you can add in your client classpath this file
> 'META-INF/org.apache.openejb.client.ConnectionFactory/ejbds' where 'ejbds'
> is a file that contains the string
> 'org.apache.openejb.client.SocketConnectionFactory'
>
> 2) in your client code you can add
> 'org.apache.openejb.client.ConnectionManager.registerFactory("ejbds", new
> org.apache.openejb.client.SocketConnectionFactory());'
>
>
> -David
>
>
>
> Christian Bourque wrote:
>>
>>>
>>> Hi,
>>>
>>> What is the correct way of using ejbd over ssl?
>>>
>>> I've tried setting this property on the server side:
>>>
>>> properties.setProperty("ejbd.secure", "true");
>>>
>>> But is there something specific to set on the client side?
>>>
>>> I always end up getting this error: "javax.net.ssl.SSLException:
>>> Unrecognized SSL message, plaintext connection?"...
>>>
>>> BTW I'm running in embedded mode with remoting...
>>>
>>> Regards,
>>>
>>> Christian
>>>
>>>
>>>
>> --
>> View this message in context:
>> http://www.nabble.com/EJBd-protocol-over-SSL-tp22188312p22228644.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>>
>>
>
Re: EJBd protocol over SSL
Posted by David Blevins <da...@visi.com>.
On Feb 26, 2009, at 9:03 AM, Jean-Sébastien Scrève wrote:
>
> Hi Christian,
>
> I'd say it's a bug.
>
> To connect, I had to set "ejbds" protocol and change openEJB code.
>
> Here is what I did to connect to the server :
>
> Properties prop = new Properties();
> prop.put(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.RemoteInitialContextFactory");
> prop.put("java.naming.provider.url", "ejbds://127.0.0.1:4201");
> prop.put("ejbd.secure", "true");
> Context myContext = new InitialContext(prop);
>
> I patched org.apache.openejb.client.ConnectionManager to let openEJB
> recognize ejbds protocol.
>
> It's not my area of expertise so is it correct to set ejbds protocol ?
That's correct. This person pinged me on irc about an hour after this
post and we got it worked out. I was just thinking to write a
followup to the list, but you beat me to it :)
As a note to any archive readers. For those that want to use SSL over
EJBd in 3.1 can do one :
1) you can add in your client classpath this file 'META-INF/
org.apache.openejb.client.ConnectionFactory/ejbds' where 'ejbds' is a
file that contains the string
'org.apache.openejb.client.SocketConnectionFactory'
2) in your client code you can add
'org.apache.openejb.client.ConnectionManager.registerFactory("ejbds",
new org.apache.openejb.client.SocketConnectionFactory());'
-David
> Christian Bourque wrote:
>>
>> Hi,
>>
>> What is the correct way of using ejbd over ssl?
>>
>> I've tried setting this property on the server side:
>>
>> properties.setProperty("ejbd.secure", "true");
>>
>> But is there something specific to set on the client side?
>>
>> I always end up getting this error: "javax.net.ssl.SSLException:
>> Unrecognized SSL message, plaintext connection?"...
>>
>> BTW I'm running in embedded mode with remoting...
>>
>> Regards,
>>
>> Christian
>>
>>
>
> --
> View this message in context: http://www.nabble.com/EJBd-protocol-over-SSL-tp22188312p22228644.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>
Re: EJBd protocol over SSL
Posted by Jean-Sébastien Scrève <je...@atosorigin.com>.
Hi Christian,
I'd say it's a bug.
To connect, I had to set "ejbds" protocol and change openEJB code.
Here is what I did to connect to the server :
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
prop.put("java.naming.provider.url", "ejbds://127.0.0.1:4201");
prop.put("ejbd.secure", "true");
Context myContext = new InitialContext(prop);
I patched org.apache.openejb.client.ConnectionManager to let openEJB
recognize ejbds protocol.
It's not my area of expertise so is it correct to set ejbds protocol ?
If so, I can create a JIRA and submit the patch.
Regards,
Jean-Sébastien Scrève.
Christian Bourque wrote:
>
> Hi,
>
> What is the correct way of using ejbd over ssl?
>
> I've tried setting this property on the server side:
>
> properties.setProperty("ejbd.secure", "true");
>
> But is there something specific to set on the client side?
>
> I always end up getting this error: "javax.net.ssl.SSLException:
> Unrecognized SSL message, plaintext connection?"...
>
> BTW I'm running in embedded mode with remoting...
>
> Regards,
>
> Christian
>
>
--
View this message in context: http://www.nabble.com/EJBd-protocol-over-SSL-tp22188312p22228644.html
Sent from the OpenEJB User mailing list archive at Nabble.com.