question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wrap() invoked when engine is already closed

See original GitHub issue

Expected behavior

wrap() not invoked when engine is closed.

Actual behavior

wrap() is invoked when engine is closed…

javax.net.ssl.SSLException: SSLEngine closed already
	at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source) ~[netty-handler-4.1.8.Final.jar:?]

Steps to reproduce

ListenableFuture<Response> listenableFuture = asyncHttpClient.preparePost(API_URL)
        .setHeader("Connection", "Keep-Alive")
        .addHeader("Content-Type", "application/json")
        .addHeader("Authorization", apiKey)
        .setBody(JsonUtils.getObjectMapper().writeValueAsBytes(data))
        .execute();
listenableFuture.toCompletableFuture().exceptionally(throwable -> {
    // SSLException logged.
    return null;
});

Minimal yet complete reproducer code (or URL to code)

None yet.

Netty version

4.1.8.Final

JVM version (e.g. java -version)

java version “1.8.0_102” Java™ SE Runtime Environment (build 1.8.0_102-b14) Java HotSpot™ 64-Bit Server VM (build 25.102-b14, mixed mode)

OS version (e.g. uname -a)

Linux xxxx 4.4.19-29.55.amzn1.x86_64 #1 SMP Mon Aug 29 23:29:40 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Scottmitchcommented, Feb 21, 2017

This exception is generated if after a wrap the SSLEngine signifies the engine has closed. At this point we will fail all pending writes which have not yet been wrapped. This may happen during the handshake or also at other times, but I don’t see any indication in this case of it being a problem. Yes please close if this makes sense and you don’t have any additional information which would indicate an issue in Netty.

0reactions
johnoucommented, Feb 21, 2017

@Scottmitch I was unsure which is why I didn’t create the issue initially, so you are saying in my scenario (using async-http-client) the client establishes a connection with the server, ssl handshake completes and before the client has a chance to send the http request the connection is interrupted / closed? If so then I am happy to close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSLEngine wrap returns CLOSED - Oracle Communities
NEED_UNWRAP means you need to call unwrap(), which will probably deliver you another SSLEngineResult with CLOSED and FINISHED. You need to do ...
Read more >
SSL Engine server side wrap() returns confusing states after ...
The client calls SSLEngine.closeOutBound() sending a close_notify. The server state is NOT_HANDSHAKING. The server unwraps. The server state becomes NEED_WRAP.
Read more >
Working with Engines and Connections — SQLAlchemy 1.3 ...
close() method is automatically invoked at the end of the block. The Connection , is a proxy object for an actual DBAPI connection....
Read more >
Closing JDBC Connections in Pool - java - Stack Overflow
It's actually a wrapper around the actual connection. It wil under the covers release ... Calling close() is OK and probably still required....
Read more >
Common Hibernate Exceptions - Baeldung
If the session is already closed when we try to access an uninitialized association, we get an exception. Let's look into this exception...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found