You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
thanks for creating this great library which supports developers to create secure software.
Version 0.8.1
Expected Behavior When I execute openssl s_client -connect $IP:$PORT to examine the example code of the non-blocking server works as expected and I can send messages to the example program.
Unexpected Behavior
But when I use the same example - except the SSLEngine setup: I used a different Certificate created via BouncyCastle - in an Android app the following Exception occurs.
As far as I understood, what seems to happen is that there is a read() which throws a NeedsReadException inside writeToChannel(), then the exception bubbles up to doHandshake( false) and therefore skips the rest of the try block and so in the next execution of tlsChannel.read(...) the code tries to begin the handshake again and the SSLEngine complains.
Excerpt from TlsChannelImpl.java:492
privatevoiddoHandshake(booleanforce) throwsIOException, EofException {
if (!force && negotiated) {
return;
}
try {
if (invalid || shutdownSent) {
thrownewClosedChannelException();
}
if (force || !negotiated) {
logger.log(Level.FINEST, "Calling SSLEngine.beginHandshake()");
engine.beginHandshake(); // <-- this is called the first time and then after the NeedsReadException when we run into the next read(...) call, its executed the second time which leads to the ISEwriteAndHandshake(); // <-- here a NeedsReadException is thrown so we jump to the finally blockif (engine.getSession().getProtocol().startsWith("DTLS")) {
thrownewIllegalArgumentException("DTLS not supported");
}
// call client codetry {
initSessionCallback.accept(engine.getSession());
} catch (Exceptione) {
logger.log(Level.FINEST, "client code threw exception in session initialization callback", e);
thrownewTlsChannelCallbackException("session initialization callback failed", e);
}
negotiated = true;
} finally {
initLock.unlock();
}
}
The text was updated successfully, but these errors were encountered:
Hi,
thanks for creating this great library which supports developers to create secure software.
Version 0.8.1
Expected Behavior When I execute
openssl s_client -connect $IP:$PORT
to examine the example code of the non-blocking server works as expected and I can send messages to the example program.Unexpected Behavior
But when I use the same example - except the SSLEngine setup: I used a different Certificate created via BouncyCastle - in an Android app the following Exception occurs.
Exception
As far as I understood, what seems to happen is that there is a read() which throws a
NeedsReadException
insidewriteToChannel()
, then the exception bubbles up todoHandshake( false)
and therefore skips the rest of the try block and so in the next execution oftlsChannel.read(...)
the code tries to begin the handshake again and theSSLEngine
complains.Excerpt from TlsChannelImpl.java:492
The text was updated successfully, but these errors were encountered: