mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cedric Lucas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DIRMINA-650) Mina server does not recieve all data sent by client using SSLSocketFactory
Date Wed, 09 Dec 2009 15:55:18 GMT

     [ https://issues.apache.org/jira/browse/DIRMINA-650?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Cedric Lucas updated DIRMINA-650:

    Attachment: SslHandler.java

Hi again,

I sent a mail in the mailing list, http://old.nabble.com/SSL-and-mina-ts26680309.html .
I think I found the problem:
As I said, the problem is when Mina is processing 1 message that contains 3 parts (or more)
containing first the end of the handshake and then 2 different messages to process.

Calls are the following:
res = unwrap0()
if (handshakeStatus == SSLEngineResult.HandshakeStatus.FINISHED
                && res.getStatus() == SSLEngineResult.Status.OK
                && inNetBuffer.hasRemaining());

Now, inside unwrap0, the condition of the do while is:
((res.getStatus() == SSLEngineResult.Status.OK || res.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW)
                 (handshakeComplete && res.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING
                  res.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_UNWRAP));

but the problem is that handshakeComplete has not been set to true (it will be just after).
So, thanks to do while, first message is processed but not the second one!

I attached a modification of the SslHandler to resolve this.
I have just created a new method unwrap0(boolean finished), calling it when doing hanshake,
and checking (finished || handshakeComplete) inside of just handshake.

Maybe you want to change it another way (I didn't watch carefully to all the remaining part).

Hope it would help


> Mina server does not recieve all data sent by client using SSLSocketFactory
> ---------------------------------------------------------------------------
>                 Key: DIRMINA-650
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-650
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>    Affects Versions: 1.1.7
>            Reporter: Kevin Koltzau
>            Priority: Critical
>             Fix For: 1.1.8
>         Attachments: SslHandler.java, SSLTest.zip, ssltest.zip
> Using mina on the server with SSLFilter, and a client using SSLSocketFactory the server
does not recieve all
> data sent by the client.
> The client creates a socket, sends data to the server and waits for a response then closes
the socket.
> The first connection works fine, if the client then repeats on the same thread the second
attempt almost always
> fails. The server never gets all the data the client sent, and so never sends a response.
> A similar problem seems to be described in DIRMINA-580, and in fact the fix described
in [1] seems to fix the problem. However the fix that was accepted into the 1.1 branch does
not correct the problem for me.
> Attached is a test case that almost always fails (on some systems I've tried it fails
every time, others it fails 5 out of 6 times)
> [1] http://issues.apache.org/jira/browse/DIRMINA-580?focusedCommentId=12595789#action_12595789

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message