Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] SSL connection failing with Mars release
[CDO] SSL connection failing with Mars release [message #1714058] Mon, 09 November 2015 15:59 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi,

I used to connect to my CDO server with a SSL connection in Luna release.
Since I migrated to Mars, connection fails with a 'java.util.concurrent.TimeoutException' on the client side whereas I get the following 'BufferUnderflowException' error on the server side :

[INFO] CDO server starting
osgi> [INFO] Net4j extension starting
[INFO] Net4j acceptor starting: ssl://localhost:2036
[INFO] Net4j extension started
[INFO] Security extension starting
[INFO] Security realm loaded from /security
[INFO] Security realm handled by AnnotationHandler
[INFO] Security realm handled by HomeFolderHandler2[/home]
[INFO] Security extension started
[INFO] CDO server started
[ERROR] BufferUnderflowException
java.nio.BufferUnderflowException
        at java.nio.Buffer.nextGetIndex(Unknown Source)
        at java.nio.DirectByteBuffer.getShort(Unknown Source)
        at org.eclipse.net4j.internal.tcp.ssl.SSLBuffer.startGetting(SSLBuffer.java:84)
        at org.eclipse.net4j.internal.tcp.TCPConnector.handleRead(TCPConnector.java:215)
        at org.eclipse.net4j.internal.tcp.ssl.SSLConnector.handleRead(SSLConnector.java:70)
        at org.eclipse.net4j.internal.tcp.TCPSelector.handleSelection(TCPSelector.java:254)
        at org.eclipse.net4j.internal.tcp.TCPSelector.run(TCPSelector.java:179)
        at java.lang.Thread.run(Unknown Source)


Is there a configuration change in the last release ?

Regards,

Laurent
Re: [CDO] SSL connection failing with Mars release [message #1714061 is a reply to message #1714058] Mon, 09 November 2015 16:19 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Laurent,

I'm afraid that the SSL code was contributed by someone who's no longer on the team. It would take me a long time to
familiarize myself with all that code and it's unlikely I would find time before December.

If you plan to find the root cause I could probably answer questions regarding concrete changes in Mars:

Mars.0: http://download.eclipse.org/modeling/emf/cdo/drops/R20150610-1526/relnotes.html
Mars.1: http://download.eclipse.org/modeling/emf/cdo/drops/R20150916-0434/relnotes.html

This bug is the only one that seems potentially related (but haven't looked at all): https://bugs.eclipse.org/477256

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 09.11.2015 um 17:00 schrieb Laurent Le Moux:
> Hi,
>
> I used to connect to my CDO server with a SSL connection in Luna release.
> Since I migrated to Mars, connection fails with a 'java.util.concurrent.TimeoutException' on the client side whereas I
> get the following 'BufferUnderflowException' error on the server side :
>
>
> [INFO] CDO server starting
> osgi> [INFO] Net4j extension starting
> [INFO] Net4j acceptor starting: ssl://localhost:2036
> [INFO] Net4j extension started
> [INFO] Security extension starting
> [INFO] Security realm loaded from /security
> [INFO] Security realm handled by AnnotationHandler
> [INFO] Security realm handled by HomeFolderHandler2[/home]
> [INFO] Security extension started
> [INFO] CDO server started
> [ERROR] BufferUnderflowException
> java.nio.BufferUnderflowException
> at java.nio.Buffer.nextGetIndex(Unknown Source)
> at java.nio.DirectByteBuffer.getShort(Unknown Source)
> at org.eclipse.net4j.internal.tcp.ssl.SSLBuffer.startGetting(SSLBuffer.java:84)
> at org.eclipse.net4j.internal.tcp.TCPConnector.handleRead(TCPConnector.java:215)
> at org.eclipse.net4j.internal.tcp.ssl.SSLConnector.handleRead(SSLConnector.java:70)
> at org.eclipse.net4j.internal.tcp.TCPSelector.handleSelection(TCPSelector.java:254)
> at org.eclipse.net4j.internal.tcp.TCPSelector.run(TCPSelector.java:179)
> at java.lang.Thread.run(Unknown Source)
>
>
> Is there a configuration change in the last release ?
>
> Regards,
>
> Laurent


Re: [CDO] SSL connection failing with Mars release [message #1714915 is a reply to message #1714061] Tue, 17 November 2015 16:32 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi Eike,

Sorry for my late answer. I try to find some time to look at this problem but I am unfortunately not an SSL expert.

Bug 477256 is apparently not the cause. The slight changes made in Signal.java seems to be involved at server startup but not anymore when the explorer tries to establish an SSL connection.

SSLBuffer.startGetting relies on an SSLEngineManager to read and unwrap encrypted data from the socket channel.

The first read returns 16 bytes of unwrapped data.
But a second read occurs and returns only 1 byte.
And SSLBuffer.startGetting is not expecting so little data.
The BufferUnderflowException occurs later on when trying to set a channel ID (2 bytes).

I put some traces in SSLEngineManager.read and, while the encrypted data seems to be normally read from the socket, unwrap returns surprisingly small data buffers...
encrypted data size : 53
unwrap result size : 16
SSL engine result : OK
Handshake status : NOT_HANDSHAKING

encrypted data size : 122
unwrap result size : 1
SSL engine result : OK
Handshake status : NOT_HANDSHAKING

BufferUnderflowException...

I migrated from Eclipse Luna + JVM 1.6 to Eclipse Mars + JVM 1.7.
And my certificates are still valid until 2020 according to keytool.

To dig further, I see no other solution than run my former platform again and compare...
Any idea or suggestion ?

Cheers,

Laurent
Re: [CDO] SSL connection failing with Mars release [message #1714918 is a reply to message #1714915] Tue, 17 November 2015 16:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 17.11.2015 um 17:32 schrieb Laurent Le Moux:
> Hi Eike,
>
> Sorry for my late answer. I try to find some time to look at this problem but I am unfortunately not an SSL expert.
>
> Bug 477256 is apparently not the cause. The slight changes made in Signal.java seems to be involved at server startup
> but not anymore when the explorer tries to establish an SSL connection.
>
> SSLBuffer.startGetting relies on an SSLEngineManager to read and unwrap encrypted data from the socket channel.
>
> The first read returns 16 bytes of unwrapped data.
> But a second read occurs and returns only 1 byte.
> And SSLBuffer.startGetting is not expecting so little data.
> The BufferUnderflowException occurs later on when trying to set a channel ID (2 bytes).
>
> I put some traces in SSLEngineManager.read and, while the encrypted data seems to be normally read from the socket,
> unwrap returns surprisingly small data buffers...
>
> encrypted data size : 53
> unwrap result size : 16
> SSL engine result : OK
> Handshake status : NOT_HANDSHAKING
>
> encrypted data size : 122
> unwrap result size : 1
> SSL engine result : OK
> Handshake status : NOT_HANDSHAKING
>
> BufferUnderflowException...
>
> I migrated from Eclipse Luna + JVM 1.6 to Eclipse Mars + JVM 1.7.
> And my certificates are still valid until 2020 according to keytool.
>
> To dig further, I see no other solution than run my former platform again and compare...
> Any idea or suggestion ?
Unfortunately not out of my head. I hope that next month I have more spare time available and then I could try to help
more proactively. Until then let me know if I can help with expertise outside of the SSL area, e.g., the lower Net4j
layers...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] SSL connection failing with Mars release [message #1714929 is a reply to message #1714918] Tue, 17 November 2015 17:22 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Me again...

My former platform and deployed products are also not working anymore with a 1.7 jvm !

And everything is fine again when I switch back to a 1.6 jvm (run a 1.7 jvm with 1.6 compatibility is not ok).

I should have started with that... Still investigating Wink
Re: [CDO] SSL connection failing with Mars release [message #1715006 is a reply to message #1714929] Wed, 18 November 2015 12:58 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi again,

I confirm the problem comes from my win32 jvm 1.7.0_17 and is apparently known :

http://stackoverflow.com/questions/19228862/ssl-connection-failing-for-java-7

While java 6 is choosing 'SSL_RSA_WITH_RC4_128_MD5' cipher for the SSL connection, java 7 uses 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA' which causes troubles after hand shake has successfully taken place.

A workaround is to filter out this cipher in jre1.7.0_17/lib/security/java.security by adding 'jdk.tls.disabledAlgorithms=AES'.

I then get 'TLS_ECDHE_RSA_WITH_RC4_128_SHA' selected which works fine.

Cheers,

Laurent
Re: [CDO] SSL connection failing with Mars release [message #1715034 is a reply to message #1715006] Wed, 18 November 2015 16:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 18.11.2015 um 13:58 schrieb Laurent Le Moux:
> Hi again,
>
> I confirm the problem comes from my win32 jvm 1.7.0_17 and is apparently known :
>
> http://stackoverflow.com/questions/19228862/ssl-connection-failing-for-java-7
>
> While java 6 is choosing 'SSL_RSA_WITH_RC4_128_MD5' cipher for the SSL connection, java 7 uses
> 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA' which causes troubles after hand shake has successfully taken place.
>
> A workaround is to filter out this cipher in jre1.7.0_17/lib/security/java.security by adding
> 'jdk.tls.disabledAlgorithms=AES'.
>
> I then get 'TLS_ECDHE_RSA_WITH_RC4_128_SHA' selected which works fine.
So there's nothing to do in CDO?

I hope I remember this thread when the next one asks :P

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO] SSL connection failing with Mars release [message #1715128 is a reply to message #1715034] Thu, 19 November 2015 13:14 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 44
Registered: June 2015
Member
Hi Eike,

There is indeed nothing to do in CDO.
And from other readings, it seems the problem disappeared in the next jvm releases...

Cheers,

Laurent
Re: [CDO] SSL connection failing with Mars release [message #1715142 is a reply to message #1715128] Thu, 19 November 2015 14:54 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 19.11.2015 um 14:14 schrieb Laurent Le Moux:
> Hi Eike,
>
> There is indeed nothing to do in CDO.
> And from other readings, it seems the problem disappeared in the next jvm releases...
Very good. Thanks for figuring this out!

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[CDO] CDO explorer product export failing in Mars release
Next Topic:Compatible Property Descriptors
Goto Forum:
  


Current Time: Fri Apr 26 23:53:13 GMT 2024

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

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

Back to the top