Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO]Security Problem
[CDO]Security Problem [message #427857] Tue, 03 March 2009 01:36 Go to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Hi,
I want to know whether the process of data transmission is encrypted.
Because my custom's data is very important, these data need to be encrypted
during transmission.
Thank you.
Re: [CDO]Security Question [message #427859 is a reply to message #427857] Tue, 03 March 2009 05:36 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
xxlu,

Neither Net4j nor CDO data transfers are encrypted by default, but
youhave different options:

1) Use an IStreamWrapper

session.options().getProtocol().setStreamWrapper(xyz)
session.options().getProtocol().addStreamWrapper(xyz)

See XORStreamWrapper for an example.

2) Use an INegotiator to set something up in the underlying IConnector

3) Develop (and hopefully contribute) a new IConnector implementation,
based on NIO sockets and the SSL encryption engine.

Cheers
/Eike

----
http://thegordian.blogspot.com



xxlu schrieb:
> Hi,
> I want to know whether the process of data transmission is encrypted.
> Because my custom's data is very important, these data need to be encrypted
> during transmission.
> Thank you.
>
>
>


Re: [CDO]Security Question [message #427860 is a reply to message #427859] Tue, 03 March 2009 05:56 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Thank you very much, Eike. I am not familiar with NIO sockets and the SSL
encryption engine technology. Can you give more in these areas to help?

"Eike Stepper" <stepper@esc-net.de>
> xxlu,
>
> Neither Net4j nor CDO data transfers are encrypted by default, but youhave
> different options:
>
> 1) Use an IStreamWrapper
>
> session.options().getProtocol().setStreamWrapper(xyz)
> session.options().getProtocol().addStreamWrapper(xyz)
>
> See XORStreamWrapper for an example.
>
> 2) Use an INegotiator to set something up in the underlying IConnector
>
> 3) Develop (and hopefully contribute) a new IConnector implementation,
> based on NIO sockets and the SSL encryption engine.
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> xxlu schrieb:
>> Hi,
>> I want to know whether the process of data transmission is encrypted.
>> Because my custom's data is very important, these data need to be
>> encrypted during transmission.
>> Thank you.
>>
>>
Re: [CDO]Security Question [message #427861 is a reply to message #427860] Tue, 03 March 2009 06:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
xxlu schrieb:
> Thank you very much, Eike. I am not familiar with NIO sockets and the SSL
> encryption engine technology. Can you give more in these areas to help?
>
Unfortunately not. I'm also not familiar with the encryption engine. I
only know that it's highly asynchronous, so that it should be feasible
to hook it into the buffer sequence processing of Net4j *somehow* ...

I'm sure that there is a lot of documentation available in the web:
http://www.google.de/search?hl=de&q=java+ssl+engine& btnG=Suche&meta=

Cheers
/Eike

----
http://thegordian.blogspot.com


> "Eike Stepper" <stepper@esc-net.de>
>
>> xxlu,
>>
>> Neither Net4j nor CDO data transfers are encrypted by default, but youhave
>> different options:
>>
>> 1) Use an IStreamWrapper
>>
>> session.options().getProtocol().setStreamWrapper(xyz)
>> session.options().getProtocol().addStreamWrapper(xyz)
>>
>> See XORStreamWrapper for an example.
>>
>> 2) Use an INegotiator to set something up in the underlying IConnector
>>
>> 3) Develop (and hopefully contribute) a new IConnector implementation,
>> based on NIO sockets and the SSL encryption engine.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>>
>>
>>
>> xxlu schrieb:
>>
>>> Hi,
>>> I want to know whether the process of data transmission is encrypted.
>>> Because my custom's data is very important, these data need to be
>>> encrypted during transmission.
>>> Thank you.
>>>
>>>
>>>
>
>
>


Re: [CDO]Security Question [message #427862 is a reply to message #427861] Tue, 03 March 2009 07:19 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Is there any help document about StreamWrapperInjector? At the Client, I
call this code: container.addPostProcessor(new
CDOXORStreamWrapperInjector()); Is it right? And what should I do at the
server side?



"Eike Stepper" <stepper@esc-net.de>
> xxlu schrieb:
>> Thank you very much, Eike. I am not familiar with NIO sockets and the
>> SSL encryption engine technology. Can you give more in these areas to
>> help?
>>
> Unfortunately not. I'm also not familiar with the encryption engine. I
> only know that it's highly asynchronous, so that it should be feasible to
> hook it into the buffer sequence processing of Net4j *somehow* ...
>
> I'm sure that there is a lot of documentation available in the web:
> http://www.google.de/search?hl=de&q=java+ssl+engine& btnG=Suche&meta=
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>> "Eike Stepper" <stepper@esc-net.de>
>>
>>> xxlu,
>>>
>>> Neither Net4j nor CDO data transfers are encrypted by default, but
>>> youhave different options:
>>>
>>> 1) Use an IStreamWrapper
>>>
>>> session.options().getProtocol().setStreamWrapper(xyz)
>>> session.options().getProtocol().addStreamWrapper(xyz)
>>>
>>> See XORStreamWrapper for an example.
>>>
>>> 2) Use an INegotiator to set something up in the underlying IConnector
>>>
>>> 3) Develop (and hopefully contribute) a new IConnector implementation,
>>> based on NIO sockets and the SSL encryption engine.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://thegordian.blogspot.com
>>>
>>>
>>>
>>> xxlu schrieb:
>>>
>>>> Hi,
>>>> I want to know whether the process of data transmission is
>>>> encrypted. Because my custom's data is very important, these data need
>>>> to be encrypted during transmission.
>>>> Thank you.
>>>>
>>>>
>>>>
>>
>>
>>
Re: [CDO]Security Question [message #427864 is a reply to message #427862] Tue, 03 March 2009 08:08 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
xxlu schrieb:
> Is there any help document about StreamWrapperInjector?
Only the (short) source code.

> At the Client, I call this code: container.addPostProcessor(new CDOXORStreamWrapperInjector()); Is it right?
Yes.

> And what should I do at the
> server side?
>
The same ;-)

BUT:

I just realized that CDONet4jSessionImpl does no longer fetch its
protocol instance from a managed container so using
StreamWrapperInjector is kind of pointless. Please try the approach 1)
from my first reply:

session.options().getProtocol().setStreamWrapper(xyz)

On the server side the injector approach should work if the protocol
provider of your acceptor is a
org.eclipse.net4j.ContainerProtocolProvider.Server

Cheers
/Eike

----
http://thegordian.blogspot.com


>
>
> "Eike Stepper" <stepper@esc-net.de>
>
>> xxlu schrieb:
>>
>>> Thank you very much, Eike. I am not familiar with NIO sockets and the
>>> SSL encryption engine technology. Can you give more in these areas to
>>> help?
>>>
>>>
>> Unfortunately not. I'm also not familiar with the encryption engine. I
>> only know that it's highly asynchronous, so that it should be feasible to
>> hook it into the buffer sequence processing of Net4j *somehow* ...
>>
>> I'm sure that there is a lot of documentation available in the web:
>> http://www.google.de/search?hl=de&q=java+ssl+engine& btnG=Suche&meta=
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>>
>>
>>
>>> "Eike Stepper" <stepper@esc-net.de>
>>>
>>>
>>>> xxlu,
>>>>
>>>> Neither Net4j nor CDO data transfers are encrypted by default, but
>>>> youhave different options:
>>>>
>>>> 1) Use an IStreamWrapper
>>>>
>>>> session.options().getProtocol().setStreamWrapper(xyz)
>>>> session.options().getProtocol().addStreamWrapper(xyz)
>>>>
>>>> See XORStreamWrapper for an example.
>>>>
>>>> 2) Use an INegotiator to set something up in the underlying IConnector
>>>>
>>>> 3) Develop (and hopefully contribute) a new IConnector implementation,
>>>> based on NIO sockets and the SSL encryption engine.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://thegordian.blogspot.com
>>>>
>>>>
>>>>
>>>> xxlu schrieb:
>>>>
>>>>
>>>>> Hi,
>>>>> I want to know whether the process of data transmission is
>>>>> encrypted. Because my custom's data is very important, these data need
>>>>> to be encrypted during transmission.
>>>>> Thank you.
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
>


Re: [CDO]Security Question [message #427865 is a reply to message #427864] Tue, 03 March 2009 08:13 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
I have the feeling that the mixed approach I suggested before is not
correct. The server protocol would wrap its streams from the beginning
(OpenSessionIndication) but the client protocol would send the
OpenSessionRequest before the stream wrapper is configured.

If you stillwant to use stream wrappers with CDO at the moment the best
way is to subclass CDONet4jSessionImpl and after calling the super
constructor configure the protocol...

Cheers
/Eike

----
http://thegordian.blogspot.com



Eike Stepper schrieb:
> xxlu schrieb:
>> Is there any help document about StreamWrapperInjector?
> Only the (short) source code.
>
>> At the Client, I call this code: container.addPostProcessor(new
>> CDOXORStreamWrapperInjector()); Is it right?
> Yes.
>
>> And what should I do at the server side?
>>
> The same ;-)
>
> BUT:
>
> I just realized that CDONet4jSessionImpl does no longer fetch its
> protocol instance from a managed container so using
> StreamWrapperInjector is kind of pointless. Please try the approach 1)
> from my first reply:
>
> session.options().getProtocol().setStreamWrapper(xyz)
>
> On the server side the injector approach should work if the protocol
> provider of your acceptor is a
> org.eclipse.net4j.ContainerProtocolProvider.Server
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>>
>>
>> "Eike Stepper" <stepper@esc-net.de>
>>
>>> xxlu schrieb:
>>>
>>>> Thank you very much, Eike. I am not familiar with NIO sockets and
>>>> the SSL encryption engine technology. Can you give more in these
>>>> areas to help?
>>>>
>>>>
>>> Unfortunately not. I'm also not familiar with the encryption engine.
>>> I only know that it's highly asynchronous, so that it should be
>>> feasible to hook it into the buffer sequence processing of Net4j
>>> *somehow* ...
>>>
>>> I'm sure that there is a lot of documentation available in the web:
>>> http://www.google.de/search?hl=de&q=java+ssl+engine& btnG=Suche&meta=
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://thegordian.blogspot.com
>>>
>>>
>>>
>>>> "Eike Stepper" <stepper@esc-net.de>
>>>>
>>>>
>>>>> xxlu,
>>>>>
>>>>> Neither Net4j nor CDO data transfers are encrypted by default, but
>>>>> youhave different options:
>>>>>
>>>>> 1) Use an IStreamWrapper
>>>>>
>>>>> session.options().getProtocol().setStreamWrapper(xyz)
>>>>> session.options().getProtocol().addStreamWrapper(xyz)
>>>>>
>>>>> See XORStreamWrapper for an example.
>>>>>
>>>>> 2) Use an INegotiator to set something up in the underlying
>>>>> IConnector
>>>>>
>>>>> 3) Develop (and hopefully contribute) a new IConnector
>>>>> implementation, based on NIO sockets and the SSL encryption engine.
>>>>>
>>>>> Cheers
>>>>> /Eike
>>>>>
>>>>> ----
>>>>> http://thegordian.blogspot.com
>>>>>
>>>>>
>>>>>
>>>>> xxlu schrieb:
>>>>>
>>>>>
>>>>>> Hi,
>>>>>> I want to know whether the process of data transmission is
>>>>>> encrypted. Because my custom's data is very important, these data
>>>>>> need to be encrypted during transmission.
>>>>>> Thank you.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>
>>


Re: [CDO]Security Question [message #427868 is a reply to message #427865] Tue, 03 March 2009 08:41 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_008C_01C99C1E.EA53EB50
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

At the server side, I start server like this:

protected void doStart() throws Exception
{
super.doStart();
OM.LOG.info("CDO Server starting");
File configFile =3D =
OMPlatform.INSTANCE.getConfigFile("cdo-server.xml");
if (configFile !=3D null && configFile.exists())
{
IPluginContainer.INSTANCE.addPostProcessor(new =
MyStreamWrapperInjector());//Add StreamWrapperInjector
=20
RepositoryConfigurator repositoryConfigurator =3D new =
RepositoryConfigurator(IPluginContainer.INSTANCE);
repositories =3D repositoryConfigurator.configure(configFile);
if (repositories =3D=3D null || repositories.length =3D=3D 0)
{
OM.LOG.warn("No repositories configured");
} =20

TransportConfigurator net4jConfigurator =3D new =
TransportConfigurator(IPluginContainer.INSTANCE);
acceptors =3D net4jConfigurator.configure(configFile);
if (acceptors =3D=3D null || acceptors.length =3D=3D 0)
{
OM.LOG.warn("No acceptors configured");
}
}
else
{
OM.LOG.warn("CDO server configuration not found: " + =
configFile.getAbsolutePath());
}

OM.LOG.info("CDO Server started");
}

Client side:

container =3D ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container); // Register Net4j factories
TCPUtil.prepareContainer(container); // Register TCP factories
CDONet4jUtil.prepareContainer(container); // Register CDO =
factories
container.activate();

=20
PasswordCredentialsProvider credentialsProvider =3D new =
PasswordCredentialsProvider(
user, password);
container.addPostProcessor(new ConnectorCredentialsInjector(
host + ":" + port, credentialsProvider));
container.addPostProcessor(new MyStreamWrapperInjector());//Add =
StreamWrapperInjector

=20
connector =3D TCPUtil.getConnector(container, host + ":" + port );

// Create configuration
CDOSessionConfiguration configuration =3D CDONet4jUtil
.createSessionConfiguration();
configuration.setConnector(connector);
configuration.setRepositoryName(repositoryName);

// Set EagerPackageRegistry
configuration.setEagerPackageRegistry();

session =3D configuration.openSession();

Are not like this?


"Eike Stepper" <stepper@esc-net.de>=20
>I have the feeling that the mixed approach I suggested before is not=20
> correct. The server protocol would wrap its streams from the beginning =

> (OpenSessionIndication) but the client protocol would send the=20
> OpenSessionRequest before the stream wrapper is configured.
>=20
> If you stillwant to use stream wrappers with CDO at the moment the =
best=20
> way is to subclass CDONet4jSessionImpl and after calling the super=20
> constructor configure the protocol...
>=20
> Cheers
> /Eike
>=20
> ----
> http://thegordian.blogspot.com
>=20
>=20
>=20
> Eike Stepper schrieb:
>> xxlu schrieb:
>>> Is there any help document about StreamWrapperInjector?=20
>> Only the (short) source code.
>>
>>> At the Client, I call this code: container.addPostProcessor(new=20
>>> CDOXORStreamWrapperInjector()); Is it right?=20
>> Yes.
>>
>>> And what should I do at the server side?
>>> =20
>> The same ;-)
>>
>> BUT:
>>
>> I just realized that CDONet4jSessionImpl does no longer fetch its=20
>> protocol instance from a managed container so using=20
>> StreamWrapperInjector is kind of pointless. Please try the approach =
1)=20
>> from my first reply:
>>
>> session.options().getProtocol().setStreamWrapper(xyz)
>>
>> On the server side the injector approach should work if the protocol=20
>> provider of your acceptor is a=20
>> org.eclipse.net4j.ContainerProtocolProvider.Server
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://thegordian.blogspot.com
>>
>>
>>>
>>>
>>> "Eike Stepper" <stepper@esc-net.de>
>>> =20
>>>> xxlu schrieb:
>>>> =20
>>>>> Thank you very much, Eike. I am not familiar with NIO sockets and =

>>>>> the SSL encryption engine technology. Can you give more in these=20
>>>>> areas to help?
>>>>>
>>>>> =20
>>>> Unfortunately not. I'm also not familiar with the encryption =
engine.=20
>>>> I only know that it's highly asynchronous, so that it should be=20
>>>> feasible to hook it into the buffer sequence processing of Net4j=20
>>>> *somehow* ...
>>>>
>>>> I'm sure that there is a lot of documentation available in the web: =

>>>> =
http://www.google.de/search?hl=3Dde&q=3Djava+ssl+engine& amp;btnG=3DSuche&meta=
=3D
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://thegordian.blogspot.com
>>>>
>>>>
>>>> =20
>>>>> "Eike Stepper" <stepper@esc-net.de>
>>>>>
>>>>> =20
>>>>>> xxlu,
>>>>>>
>>>>>> Neither Net4j nor CDO data transfers are encrypted by default, =
but=20
>>>>>> youhave different options:
>>>>>>
>>>>>> 1) Use an IStreamWrapper
>>>>>>
>>>>>> session.options().getProtocol().setStreamWrapper(xyz)
>>>>>> session.options().getProtocol().addStreamWrapper(xyz)
>>>>>>
>>>>>> See XORStreamWrapper for an example.
>>>>>>
>>>>>> 2) Use an INegotiator to set something up in the underlying=20
>>>>>> IConnector
>>>>>>
>>>>>> 3) Develop (and hopefully contribute) a new IConnector=20
>>>>>> implementation, based on NIO sockets and the SSL encryption =
engine.
>>>>>>
>>>>>> Cheers
>>>>>> /Eike
>>>>>>
>>>>>> ----
>>>>>> http://thegordian.blogspot.com
>>>>>>
>>>>>>
>>>>>>
>>>>>> xxlu schrieb:
>>>>>>
>>>>>> =20
>>>>>>> Hi,
>>>>>>> I want to know whether the process of data transmission is=20
>>>>>>> encrypted. Because my custom's data is very important, these =
data=20
>>>>>>> need to be encrypted during transmission.
>>>>>>> Thank you.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> =20
>>>>>
>>>>> =20
>>>
>>>
>>>
------=_NextPart_000_008C_01C99C1E.EA53EB50
Content-Type: text/html;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-15">
<META content=3D"MSHTML 6.00.6000.16809" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>At the server side, I start =
server like=20
this:</FONT></DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>&nbsp; protected void =
doStart() throws=20
Exception<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp;=20
super.doStart();<BR>&nbsp;&nbsp;&nbsp; OM.LOG.info("CDO Server=20
starting");<BR>&nbsp;&nbsp;&nbsp; File configFile =3D=20
OMPlatform.INSTANCE.getConfigFile("cdo-server.xml");<BR>&nbsp;&nbsp;&nbsp=
; if=20
(configFile !=3D null &amp;&amp; =
configFile.exists())<BR>&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
IPluginContainer.INSTANCE.addPostProcessor(new =
MyStreamWrapperInjector());//Add=20
StreamWrapperInjector<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
RepositoryConfigurator repositoryConfigurator =3D new=20
RepositoryConfigurator(IPluginContainer.INSTANCE);<BR>&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
repositories =3D=20
repositoryConfigurator.configure(configFile);<BR>&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
if (repositories =3D=3D null || repositories.length =3D=3D=20
0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; OM.LOG.warn("No =
repositories=20
configured");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TransportConfigurator=20
net4jConfigurator =3D new=20
TransportConfigurator(IPluginContainer.INSTANCE);<BR>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;=20
acceptors =3D=20
net4jConfigurator.configure(configFile);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; if=20
(acceptors =3D=3D null || acceptors.length =3D=3D =
0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
{<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; OM.LOG.warn("No =
acceptors=20
configured");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OM.LOG.warn("CDO server =
configuration not=20
found: " + configFile.getAbsolutePath());<BR>&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>&nbsp;&nbsp;&nbsp; =
OM.LOG.info("CDO Server=20
started");<BR>&nbsp; }</FONT></DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>Client side:</FONT></DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>container =3D=20
ContainerUtil.createContainer();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Net4jUtil.prepareContainer(container); // Register Net4j=20
factories<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
TCPUtil.prepareContainer(container);=20
// Register TCP factories<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
CDONet4jUtil.prepareContainer(container); // Register CDO=20
factories<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
container.activate();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307;=20
size=3D2>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;PasswordCredentialsProvi=
der=20
credentialsProvider =3D new=20
PasswordCredentialsProvider(<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user,=20
password);<BR> &nbsp;&nbsp;&nbsp;container.addPostProcessor(new =20
ConnectorCredentialsInjector(<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbs=
p;host=20
+ ":" + port,=20
credentialsProvider));<BR> &nbsp;&nbsp;&nbsp;container.addPostProcessor(ne=
w=20
MyStreamWrapperInjector());//Add=20
StreamWrapperInjector<BR><BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;conn=
ector =3D=20
TCPUtil.getConnector(container, host + ":" + port );</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>&nbsp;&nbsp;&nbsp;// Create=20
configuration<BR>&nbsp;&nbsp;&nbsp;CDOSessionConfiguration configuration =
=3D=20
CDONet4jUtil<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.createSes sionConfiguration=
();<BR> &nbsp;&nbsp;&nbsp;configuration.setConnector(con nector); <BR>&nbsp;=
&nbsp;&nbsp;configuration.setRepositoryName(reposito ryName); </FONT></DIV>=

<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>&nbsp;&nbsp;&nbsp;// Set=20
EagerPackageRegistry<BR> &nbsp;&nbsp;&nbsp;configuration.setEagerPackageR e=
gistry();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>&nbsp;&nbsp;&nbsp;session =
=3D=20
configuration.openSession();</FONT></DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>
<DIV id=3Dresult_box dir=3Dltr style=3D"TEXT-ALIGN: left">Are not like=20
this?</DIV></FONT></DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>"Eike Stepper" &lt;</FONT><A =

href=3D"mailto:stepper@esc-net.de"><FONT face=3D&#23435;&#20307;=20
size=3D2>stepper@esc-net.de</FONT></A><FONT face=3D&#23435;&#20307; =
size=3D2>&gt; </FONT></DIV>
<DIV><FONT face=3D&#23435;&#20307; size=3D2>&gt;I have the feeling that =
the mixed approach I=20
suggested before is not <BR>&gt; correct. The server protocol would wrap =
its=20
streams from the beginning <BR>&gt; (OpenSessionIndication) but the =
client=20
protocol would send the <BR>&gt; OpenSessionRequest before the stream =
wrapper is=20
configured.<BR>&gt; <BR>&gt; If you stillwant to use stream wrappers =
with CDO at=20
the moment the best <BR>&gt; way is to subclass CDONet4jSessionImpl and =
after=20
calling the super <BR>&gt; constructor configure the protocol...<BR>&gt; =

<BR>&gt; Cheers<BR>&gt; /Eike<BR>&gt; <BR>&gt; ----<BR>&gt; </FONT><A=20
href=3D"http://thegordian.blogspot.com"><FONT face=3D&#23435;&#20307;=20
size=3D2>http://thegordian.blogspot.com</FONT></A><BR><FONT =
face=3D&#23435;&#20307; size=3D2>&gt;=20
<BR>&gt; <BR>&gt; <BR>&gt; Eike Stepper schrieb:<BR>&gt;&gt; xxlu=20
schrieb:<BR>&gt;&gt;&gt; Is there any help document about =
StreamWrapperInjector?=20
<BR>&gt;&gt; Only the (short) source code.<BR>&gt;&gt;<BR>&gt;&gt;&gt; =
At the=20
Client, I call this code: container.addPostProcessor(new =
<BR>&gt;&gt;&gt;=20
CDOXORStreamWrapperInjector());&nbsp; Is it right? <BR>&gt;&gt;=20
Yes.<BR>&gt;&gt;<BR>&gt;&gt;&gt;&nbsp; And what should I do at the =
server=20
side?<BR>&gt;&gt;&gt;&nbsp;&nbsp; <BR>&gt;&gt; The same=20
;-)<BR>&gt;&gt;<BR>&gt;&gt; BUT:<BR>&gt;&gt;<BR>&gt;&gt; I just realized =
that=20
CDONet4jSessionImpl does no longer fetch its <BR>&gt;&gt; protocol =
instance from=20
a managed container so using <BR>&gt;&gt; StreamWrapperInjector is kind =
of=20
pointless. Please try the approach 1) <BR>&gt;&gt; from my first=20
reply:<BR>&gt;&gt;<BR> &gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp; =

session.options().getProtocol().setStreamWrapper(xyz)<BR>&gt;&gt; <BR>&gt;=
&gt; On=20
the server side the injector approach should work if the protocol =
<BR>&gt;&gt;=20
provider of your acceptor is a <BR>&gt;&gt;=20
org.eclipse.net4j.ContainerProtocolProvider.Server<BR>&gt;&gt; <BR>&gt;&gt=
;=20
Cheers<BR>&gt;&gt; /Eike<BR>&gt;&gt;<BR>&gt;&gt; ----<BR>&gt;&gt; =
</FONT><A=20
href=3D"http://thegordian.blogspot.com"><FONT face=3D&#23435;&#20307;=20
size=3D2>http://thegordian.blogspot.com</FONT></A><BR><FONT =
face=3D&#23435;&#20307;=20
size=3D2>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;&gt; <BR>&gt;&gt;&gt;<BR>&gt;&gt;=
&gt;=20
"Eike Stepper" &lt;</FONT><A href=3D"mailto:stepper@esc-net.de"><FONT =
face=3D&#23435;&#20307;=20
size=3D2>stepper@esc-net.de</FONT></A><FONT face=3D&#23435;&#20307;=20
size=3D2>&gt;<BR>&gt;&gt;&gt;&nbsp; <BR>&gt;&gt;&gt;&gt; xxlu=20
schrieb:<BR> &gt;&gt;&gt;&gt;&nbsp;&nbsp;&nbs p; <BR>&gt;&gt;&gt;&gt;&gt; =
Thank=20
you very much, Eike.&nbsp; I am not familiar with NIO sockets and=20
<BR>&gt;&gt;&gt;&gt;&gt; the SSL encryption engine technology. Can you =
give more=20
in these <BR>&gt;&gt;&gt;&gt;&gt; areas to=20
help?<BR>&gt;&gt;&gt;&gt;&gt;<BR> &gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp; &nbsp;&n=
bsp;&nbsp;&nbsp;=20
<BR>&gt;&gt;&gt;&gt; Unfortunately not. I'm also not familiar with the=20
encryption engine. <BR>&gt;&gt;&gt;&gt; I only know that it's highly=20
asynchronous, so that it should be <BR>&gt;&gt;&gt;&gt; feasible to hook =
it into=20
the buffer sequence processing of Net4j <BR>&gt;&gt;&gt;&gt; *somehow*=20
....<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; I'm sure that there is a lot =
of=20
documentation available in the web: <BR>&gt;&gt;&gt;&gt; </FONT><A=20
href=3D"http://www.google.de/search?hl=3Dde&amp;q=3Djava+ssl+engine&amp;b=
tnG=3DSuche&amp;meta"><FONT=20
face=3D&#23435;&#20307;=20
size=3D2>http://www.google.de/search?hl=3Dde&amp;q=3Djava+ssl+engine&amp;=
btnG=3DSuche&amp;meta</FONT></A><FONT=20
face=3D&#23435;&#20307; =
size=3D2>=3D<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;=20
Cheers<BR>&gt;&gt;&gt;&gt; /Eike<BR>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; =

----<BR>&gt;&gt;&gt;&gt; </FONT><A =
href=3D"http://thegordian.blogspot.com"><FONT=20
face=3D&#23435;&#20307; =
size=3D2>http://thegordian.blogspot.com</FONT></A><BR><FONT =
face=3D&#23435;&#20307;=20
size=3D2>&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&nbsp;&n=
bsp;&nbsp;=20
<BR>&gt;&gt;&gt;&gt;&gt; "Eike Stepper" &lt;</FONT><A=20
href=3D"mailto:stepper@esc-net.de"><FONT face=3D&#23435;&#20307;=20
size=3D2>stepper@esc-net.de</FONT></A><FONT face=3D&#23435;&#20307;=20
size=3D2>&gt;<BR>&gt;&gt;&gt;&gt;&gt; <BR> &gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
<BR>&gt;&gt;&gt;&gt;&gt;&gt;=20
xxlu,<BR>&gt;&gt;&gt;&gt;&gt;&gt;<BR >&gt;&gt;&gt;&gt;&gt;&gt; Neither =
Net4j nor=20
CDO data transfers are encrypted by default, but =
<BR>&gt;&gt;&gt;&gt;&gt;&gt;=20
youhave different=20
options:<BR>&gt;&gt;&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&gt;&gt; 1) Use =
an=20
IStreamWrapper<BR>&gt;&gt;&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&gt;&gt;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
session.options().getProtocol().setStreamWrapper(xyz)<BR>&gt;&gt;&gt;&gt;=
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;=20
session.options().getProtocol().addStreamWrapper(xyz)<BR>&gt;&gt;&gt;&gt;=
&gt;&gt;<BR> &gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&a mp;nbsp;&nbsp;=20
See XORStreamWrapper for an=20
example.<BR>&gt;&gt;&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&gt;&gt; 2) Use =
an=20
INegotiator to set something up in the underlying =
<BR>&gt;&gt;&gt;&gt;&gt;&gt;=20
IConnector<BR>&gt;&gt;&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&gt;&gt; 3) =
Develop=20
(and hopefully contribute) a new IConnector <BR>&gt;&gt;&gt;&gt;&gt;&gt; =

implementation, based on NIO sockets and the SSL encryption=20
engine.<BR>&gt;&gt;&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&gt;&gt;=20
Cheers<BR>&gt;&gt;&gt;&gt;&gt;&gt;=20
/Eike<BR>&gt;&gt;&gt;&gt;&gt;&gt;<BR >&gt;&gt;&gt;&gt;&gt;&gt;=20
----<BR>&gt;&gt;&gt;&gt;&gt;&gt; </FONT><A=20
href=3D"http://thegordian.blogspot.com"><FONT face=3D&#23435;&#20307;=20
size=3D2>http://thegordian.blogspot.com</FONT></A><BR><FONT =
face=3D&#23435;&#20307;=20
size=3D2>&gt;&gt;&gt;&gt;&gt;&gt;<BR >&gt;&gt;&gt;&gt;&gt;&gt;<BR>&gt;&gt;=
&gt;&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;&gt;=20
xxlu=20
schrieb:<BR>&gt;&gt;&gt;&gt;&gt;&gt; <BR> &gt;&gt;&gt;&gt;&gt;&gt;&nbsp;&a mp;nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>&gt;&gt;&gt;&gt;&gt;&gt;&gt;=20
Hi,<BR> &gt;&gt;&gt;&gt;&gt;&gt;&gt;& ;nbsp;&nbsp;&nbsp; I want to know =
whether the=20
process of data transmission is <BR>&gt;&gt;&gt;&gt;&gt;&gt;&gt; =
encrypted.=20
Because my custom's data is very important, these data=20
<BR>&gt;&gt;&gt;&gt;&gt;&gt;&gt; need to be encrypted during=20
transmission.<BR> &gt;&gt;&gt;&gt;&gt;&gt;&gt;& ;nbsp;&nbsp;&nbsp; Thank=20
you.<BR>&gt;&gt;&gt;&gt;&gt;&gt;&gt; <BR>&gt;&gt;&gt;&gt;&gt;&gt;&gt; <BR>&=
gt;&gt;&gt;&gt;&gt;&gt;&gt;<BR> &gt;&gt;&gt;&gt;&gt;&gt;&gt;& ;nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;=20
<BR>&gt;&gt;&gt;&gt;&gt;<BR> &gt;&gt;&gt;&gt;&gt;&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp;&nbsp;=20
<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;<BR >&gt;&gt;&gt;</FONT></DIV></BODY></HTM=
L>

------=_NextPart_000_008C_01C99C1E.EA53EB50--
Re: [CDO]Security Question [message #427870 is a reply to message #427868] Tue, 03 March 2009 09:00 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Xxlu,

That looks good.
But don't forget to hook the streamwrapper into the client side session
protocol, too!

Cheers
/Eike

----
http://thegordian.blogspot.com


Cheers
/Eike

----
http://thegordian.blogspot.com



xxlu schrieb:
> At the server side, I start server like this:
> protected void doStart() throws Exception
> {
> super.doStart();
> OM.LOG.info("CDO Server starting");
> File configFile = OMPlatform.INSTANCE.getConfigFile("cdo-server.xml");
> if (configFile != null && configFile.exists())
> {
> IPluginContainer.INSTANCE.addPostProcessor(new
> MyStreamWrapperInjector());//Add StreamWrapperInjector
>
> RepositoryConfigurator repositoryConfigurator = new
> RepositoryConfigurator(IPluginContainer.INSTANCE);
> repositories = repositoryConfigurator.configure(configFile);
> if (repositories == null || repositories.length == 0)
> {
> OM.LOG.warn("No repositories configured");
> }
> TransportConfigurator net4jConfigurator = new
> TransportConfigurator(IPluginContainer.INSTANCE);
> acceptors = net4jConfigurator.configure(configFile);
> if (acceptors == null || acceptors.length == 0)
> {
> OM.LOG.warn("No acceptors configured");
> }
> }
> else
> {
> OM.LOG.warn("CDO server configuration not found: " +
> configFile.getAbsolutePath());
> }
> OM.LOG.info("CDO Server started");
> }
> Client side:
> container = ContainerUtil.createContainer();
> Net4jUtil.prepareContainer(container); // Register Net4j factories
> TCPUtil.prepareContainer(container); // Register TCP factories
> CDONet4jUtil.prepareContainer(container); // Register CDO factories
> container.activate();
>
> PasswordCredentialsProvider credentialsProvider = new
> PasswordCredentialsProvider(
> user, password);
> container.addPostProcessor(new ConnectorCredentialsInjector(
> host + ":" + port, credentialsProvider));
> container.addPostProcessor(new MyStreamWrapperInjector());//Add
> StreamWrapperInjector
>
>
> connector = TCPUtil.getConnector(container, host + ":" + port );
> // Create configuration
> CDOSessionConfiguration configuration = CDONet4jUtil
> .createSessionConfiguration();
> configuration.setConnector(connector);
> configuration.setRepositoryName(repositoryName);
> // Set EagerPackageRegistry
> configuration.setEagerPackageRegistry();
> session = configuration.openSession();
> Are not like this?
> "Eike Stepper" <stepper@esc-net.de <mailto:stepper@esc-net.de>>
> >I have the feeling that the mixed approach I suggested before is not
> > correct. The server protocol would wrap its streams from the beginning
> > (OpenSessionIndication) but the client protocol would send the
> > OpenSessionRequest before the stream wrapper is configured.
> >
> > If you stillwant to use stream wrappers with CDO at the moment the best
> > way is to subclass CDONet4jSessionImpl and after calling the super
> > constructor configure the protocol...
> >
> > Cheers
> > /Eike
> >
> > ----
> > http://thegordian.blogspot.com
> >
> >
> >
> > Eike Stepper schrieb:
> >> xxlu schrieb:
> >>> Is there any help document about StreamWrapperInjector?
> >> Only the (short) source code.
> >>
> >>> At the Client, I call this code: container.addPostProcessor(new
> >>> CDOXORStreamWrapperInjector()); Is it right?
> >> Yes.
> >>
> >>> And what should I do at the server side?
> >>>
> >> The same ;-)
> >>
> >> BUT:
> >>
> >> I just realized that CDONet4jSessionImpl does no longer fetch its
> >> protocol instance from a managed container so using
> >> StreamWrapperInjector is kind of pointless. Please try the approach 1)
> >> from my first reply:
> >>
> >> session.options().getProtocol().setStreamWrapper(xyz)
> >>
> >> On the server side the injector approach should work if the protocol
> >> provider of your acceptor is a
> >> org.eclipse.net4j.ContainerProtocolProvider.Server
> >>
> >> Cheers
> >> /Eike
> >>
> >> ----
> >> http://thegordian.blogspot.com
> >>
> >>
> >>>
> >>>
> >>> "Eike Stepper" <stepper@esc-net.de <mailto:stepper@esc-net.de>>
> >>>
> >>>> xxlu schrieb:
> >>>>
> >>>>> Thank you very much, Eike. I am not familiar with NIO sockets and
> >>>>> the SSL encryption engine technology. Can you give more in these
> >>>>> areas to help?
> >>>>>
> >>>>>
> >>>> Unfortunately not. I'm also not familiar with the encryption engine.
> >>>> I only know that it's highly asynchronous, so that it should be
> >>>> feasible to hook it into the buffer sequence processing of Net4j
> >>>> *somehow* ....
> >>>>
> >>>> I'm sure that there is a lot of documentation available in the web:
> >>>>
> http://www.google.de/search?hl=de&q=java+ssl+engine& btnG=Suche&meta
> < http://www.google.de/search?hl=de&q=java+ssl+engine& btnG=Suche&meta>=
> >>>>
> >>>> Cheers
> >>>> /Eike
> >>>>
> >>>> ----
> >>>> http://thegordian.blogspot.com
> >>>>
> >>>>
> >>>>
> >>>>> "Eike Stepper" <stepper@esc-net.de <mailto:stepper@esc-net.de>>
> >>>>>
> >>>>>
> >>>>>> xxlu,
> >>>>>>
> >>>>>> Neither Net4j nor CDO data transfers are encrypted by default, but
> >>>>>> youhave different options:
> >>>>>>
> >>>>>> 1) Use an IStreamWrapper
> >>>>>>
> >>>>>> session.options().getProtocol().setStreamWrapper(xyz)
> >>>>>> session.options().getProtocol().addStreamWrapper(xyz)
> >>>>>>
> >>>>>> See XORStreamWrapper for an example.
> >>>>>>
> >>>>>> 2) Use an INegotiator to set something up in the underlying
> >>>>>> IConnector
> >>>>>>
> >>>>>> 3) Develop (and hopefully contribute) a new IConnector
> >>>>>> implementation, based on NIO sockets and the SSL encryption engine.
> >>>>>>
> >>>>>> Cheers
> >>>>>> /Eike
> >>>>>>
> >>>>>> ----
> >>>>>> http://thegordian.blogspot.com
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> xxlu schrieb:
> >>>>>>
> >>>>>>
> >>>>>>> Hi,
> >>>>>>> I want to know whether the process of data transmission is
> >>>>>>> encrypted. Because my custom's data is very important, these data
> >>>>>>> need to be encrypted during transmission.
> >>>>>>> Thank you.
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>
> >>>
> >>>


Previous Topic:Problem with table viewer and databinding an EMF object
Next Topic:[CDO] Advise on transferring large set of data
Goto Forum:
  


Current Time: Thu Apr 25 16:30:00 GMT 2024

Powered by FUDForum. Page generated in 0.04170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top