jruby-openssl icon indicating copy to clipboard operation
jruby-openssl copied to clipboard

OpenSSL::SSL::SSLContext does not implement npn_protocols

Open ostinelli opened this issue 9 years ago • 3 comments

jruby-9.0.5.0
Darwin 14.5.0 Darwin Kernel Version 14.5.0: root:xnu-2782.50.3~1/RELEASE_X86_64 x86_64

npn_protocols allows to set the protocols to be advertised as the list of supported protocols for Next Protocol Negotiation. This is very useful in HTTP/2, since the protocol is still in draft and some servers will not accept calls without a clear statement on the protocol used in the request.

Without this method, it is not possible to build highly-compatible HTTP/2 clients in JRuby.

Moved from https://github.com/jruby/jruby/issues/3987 as requested.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/35819756-openssl-ssl-sslcontext-does-not-implement-npn_protocols?utm_campaign=plugin&utm_content=tracker%2F136995&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F136995&utm_medium=issues&utm_source=github).

ostinelli avatar Jul 07 '16 09:07 ostinelli

also note that it is not possible to build proper H2 servers using JRuby without some sort of subsequent protocol negotiation.

looks like jruby-openssl is up to 1.1.0, and since this is an H2 request, perhaps it should be considered to use ALPN instead of older NPN as specified in the HTTP/2 spec. for reference, here is the commit that added ALPN to MRI.

i would be open to trying to help code-wise, but my java is extremely rusty and it may be better for me to put some dollars on the bounty. if that would get some movement here, i'd be happy to do so. thanks!

kenichi avatar Sep 01 '17 20:09 kenichi

alpn_protocols and alpn_select_cb are to be available from https://github.com/jruby/jruby-openssl/pull/247 ... for the older npn_protocols counterpart I am not sure that's going to be needed given the NPN functionality overlaps with ALPN. we could alias npn_xxx to alpn_xxx but I am not sure about the differences in ALPN vs NPN in terms of OpenSSL.

kares avatar Feb 03 '22 12:02 kares