-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some devices occurs infinite loop in unwrap when start sslserver. #424
Comments
hey @TomWangTW, could you maybe provide a stacktrace for your issue? Greetings |
Hi Marci4,
But when you use some devices which android version between 5.0~5.1 and it always will happen. |
Hey @TomWangTW, I am going to reduce the use of recursive calls, hopefully this helps your problem. Greetings |
Hello @TomWangTW, I merged some changes from my development repository to the main repository. Could you please build the jar directly from these sources and check if this fixes your issue? Greetings |
Hi marci4. |
Hi Marci4,
It is 100% happen in Android 5.0.x devices but work normally with other Android version... |
Hello @TomWangTW, can I reproduce this issue in the emulator as well? Greetings EDIT: Tried it in the emulator, cannot reproduce it this way.... |
Hi Marci4, I will trace this issue when i have time, but the other project(AndroidAsync) looks work normally with Android 5.0.x. |
Right now I am moving away from the currently used SSLSocketChannel and write our own one! |
Little update here: Got a SSLSocketChannel that works with every Android version from API Level 17 -25 :) Working on some finishing touches (including talking to the author). Greetings |
Hello @TomWangTW, I merged some changes to the main branch. Greetings |
@marci4 Is this fix in the master now? I saw some reverts in the commit log. |
Hello @miopa, I had to remove it. Gonna push it to the main branch anyway later again to allow more testing! Greetings |
Hello @marci4 I will upload result when i test it. By the way, do you know the root cause? |
Hello @TomWangTW the cause for this problem is this issue https://issuetracker.google.com/issues/37044892 This combined with the not so perfect usage of the SSLEngine causes the problem! Greetings |
Have to move this issue to 1.3.5... |
Hundreds of our users are currently having this issue. Could you give any clues on how to solve this problem or where exactly it stems from? |
Hello @sepehr1014, The only way to fix this issue is just to replace the current SSLChannel implementation with a total new one... Greetings |
I found some devices occurs infinite loop in unwrap when start sslserver.
Is anybody know what is going on?
The condition is always true and log like this:
getHandshakeStatus NEED_WRAP
readEngineResult OK
getHandshakeStatus NEED_UNWRAP
readEngineResult OK
getHandshakeStatus NEED_UNWRAP
readEngineResult OK
....
////////////////////////
SSLSocketChannel2.java
private synchronized ByteBuffer unwrap() throws SSLException {
int rem;
do {
rem = inData.remaining();
readEngineResult = sslEngine.unwrap( inCrypt, inData );
} while ( readEngineResult.getStatus() == SSLEngineResult.Status.OK && ( rem != inData.remaining() ||
sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_UNWRAP ) );
inData.flip();
return inData;
}
The text was updated successfully, but these errors were encountered: