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.

Netty Client does not detect when ALPN was not used

See original GitHub issue

When I tried to reproduce the APLN silence failure, I expected the following change fails our tests, but not, all tests still passed.

diff --git a/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java b/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java
index 504c815..2ae8160 100644
--- a/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java
+++ b/interop-testing/src/test/java/io/grpc/testing/integration/Http2NettyTest.java
@@ -37,6 +37,7 @@ import io.grpc.transport.netty.GrpcSslContexts;
 import io.grpc.transport.netty.NettyChannelBuilder;
 import io.grpc.transport.netty.NettyServerBuilder;

+import io.netty.handler.ssl.ApplicationProtocolConfig;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.runner.RunWith;
@@ -74,7 +75,8 @@ public class Http2NettyTest extends AbstractTransportTest {
       return NettyChannelBuilder
           .forAddress(TestUtils.testServerAddress(serverPort))
           .sslContext(GrpcSslContexts.forClient().trustManager(
-                  TestUtils.loadCert("ca.pem")).build())
+                  TestUtils.loadCert("ca.pem"))
+              .applicationProtocolConfig(ApplicationProtocolConfig.DISABLED).build())
           .build();
     } catch (Exception ex) {
       throw new RuntimeException(ex);

The problem itself is not a big deal, but investigating it may expose some hidden bugs.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
ejona86commented, Jun 16, 2016

@buchgr, that’s a pretty weak error message. Very few people would be able to figure out what’s wrong in that case.

0reactions
buchgrcommented, Jun 16, 2016

When I disable ALPN all tests in Http2NettyTest fail with

io.grpc.testing.integration.Http2NettyTest > deadlineInPast FAILED
    io.grpc.StatusRuntimeException: UNAVAILABLE

        Caused by:
        javax.net.ssl.SSLException: engine closed

Isn’t that what we want, @ejona86 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - How to solve "Neither Jetty ALPN nor OpenSSL via netty ...
We've just released the 0.9.1 client that paired with Netty tcnative-boringssl-static we use Fork19 as shown in the connector examples and pardo hello ......
Read more >
ApplicationProtocolNegotiationH...
See the 13 * License for the specific language governing permissions and ... to use when 81 * ALPN/NPN negotiation fails or the...
Read more >
Requirements for 4.x - Netty.docs
ALPN is a fairly new standard and (where possible) Netty supports protocol negotiation via NPN for systems that do not yet support ALPN....
Read more >
Http2Client xref - Netty
See the License for the specific language governing permissions and limitations ... example for a HTTP2 client example which does not use 59...
Read more >
JdkAlpnSslEngine xref - Netty
isEmpty()) { 77 // ALPN is not supported 78 selector.unsupported(); 79 } 80 } ... 121 if (alpnSelector == null) { 122 //...
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