diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-12-18 11:04:33 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-12-18 11:06:23 +0900 |
commit | 6becc12ef4e7235e749a92e3115b1155b39fc9e4 (patch) | |
tree | 32667184a70e9af1ccb5537092cf9a3ba24aac8a | |
parent | dcff9005d8c3a99b1d820f7f5891bc500b5e9bc6 (diff) | |
download | plum-6becc12ef4e7235e749a92e3115b1155b39fc9e4.tar.gz |
client: remove NPN support (Ruby 2.3.0 will be released soon)
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | lib/plum/client.rb | 12 |
3 files changed, 4 insertions, 11 deletions
@@ -1,5 +1,6 @@ /.bundle/ /.yardoc +/.ruby-version /Gemfile.lock /_yardoc/ /coverage/ @@ -63,7 +63,7 @@ If the server does't support HTTP/2, `Plum::Client` tries to use HTTP/1.x instea +-----------------+ v "https" +-----------------+ - | ALPN(/NPN) | failed + | ALPN | failed | negotiation |-------> HTTP/1.x +-----------------+ | "h2" diff --git a/lib/plum/client.rb b/lib/plum/client.rb index 103d938..020b372 100644 --- a/lib/plum/client.rb +++ b/lib/plum/client.rb @@ -143,8 +143,7 @@ module Plum @socket.connect @socket.post_connection_check(@config[:hostname]) if ctx.verify_mode != OpenSSL::SSL::VERIFY_NONE - @socket.respond_to?(:alpn_protocol) && @socket.alpn_protocol == "h2" || - @socket.respond_to?(:npn_protocol) && @socket.npn_protocol == "h2" + @socket.alpn_protocol == "h2" end end @@ -176,14 +175,7 @@ module Plum ctx.cert_store = cert_store if @config[:http2] ctx.ciphers = "ALL:!" + SSLSocketServerConnection::CIPHER_BLACKLIST.join(":!") - if ctx.respond_to?(:alpn_protocols) - ctx.alpn_protocols = ["h2", "http/1.1"] - end - if ctx.respond_to?(:npn_select_cb) # TODO: RFC 7540 does not define protocol negotiation with NPN - ctx.npn_select_cb = -> protocols { - protocols.include?("h2") ? "h2" : protocols.first - } - end + ctx.alpn_protocols = ["h2", "http/1.1"] end ctx end |