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.

NPN clients fail when talking to NPN servers that don't advertise

See original GitHub issue

Expected behavior

Netty clients that support NPN should be able to talk to any server that supports NPN.

Actual behavior

When netty clients using tcnative + NPN try to talk to servers that support NPN but don’t advertise any protocols, netty barfs.

Steps to reproduce

Use an SslContextBuilder, and call the applicationProtocolConfig, passing an ApplicationProtocolConfig where the Protocol is either Protocol.NPN_AND_ALPN or Protocol.NPN. Then talk to a server that supports NPN but doesn’t advertise NPN protocols, like happylifestyle.com or ossifrage.net.

Minimal yet complete reproducer code (or URL to code)

Using finagle:

import com.twitter.util.Await
import com.twitter.finagle.Http
import com.twitter.finagle.http.Request
val req = Request("/")
req.host = "happylifestyle.com"
val client = Http.client.configuredParams(Http.Http2).withTls("happylifestyle.com").newService("happylifestyle.com:443")
Await.result(client(req))

You can also do this when talking to ossifrage.net.

Note if you use openssl s_client -tlsextdebug -connect ossifrage.net:443 -nextprotoneg 'h2,http/1.1' that it doesn’t advertise any protocols.

Netty version

4.1.16.Final

tcnative version

2.0.6.Final

JVM version (e.g. java -version)

JDK8

OS version (e.g. uname -a)

Darwin tw-mbp13-mnakamura.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:22 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Oct 11, 2019

Let me just close this for now. @mosesn please re-open if you still think there is an issue.

1reaction
ryanoneillcommented, Oct 31, 2017

FYI, I think @mosesn meant to put 4.1.16.Final as the version of Netty that we’re using, not 4.1.6.Final.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP/2 Theory and Practice in NGINX Stable, Part 1
In Part 2, Nathan talks about implementing HTTP/2 with NGINX, running benchmarks, and more. ... 13:56, NPN/ALPN – Why You Need to Know....
Read more >
java - Cloud Bigtable Failure due to NPN/ALPN extensions not ...
I have java version "1.7.0_60" installed so I've updated pom entry as; <alpn.version>7.1.0.v20141016</alpn.version> however it does not help anything...
Read more >
Tutorial: HTTP/2 client — nghttp2 1.52.0-DEV documentation
The NPN callback is used by the client to select the next application protocol over TLS. ... outlen, in, inlen) <= 0) {...
Read more >
HTTP/2 Test - Verify HTTP/2 Support - KeyCDN Tools
However, NPN advertises the supported protocols from the server to the client and this test will show the advertised protocols if HTTP/2 is...
Read more >
Networking 101: Transport Layer Security (TLS)
Worse, even if an attacker does not currently have access to the private key, ... In NPN, the server advertised which protocols it...
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