diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-07 16:42:36 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-07 16:42:36 +0900 |
commit | 6418b22ff8fcaf7c3b7b1c3a81d2b98c23f66ea3 (patch) | |
tree | 041a5c01d10b655b9a2ddcfb51ecb6446447d4b8 /lib/plum | |
parent | 7d4afee71eee8f1c242d400affb278e3bd4fd276 (diff) | |
download | plum-6418b22ff8fcaf7c3b7b1c3a81d2b98c23f66ea3.tar.gz |
client: hostname is set in SSLSocket, not in SSLContext
Diffstat (limited to 'lib/plum')
-rw-r--r-- | lib/plum/client.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/plum/client.rb b/lib/plum/client.rb index 35c4001..197b214 100644 --- a/lib/plum/client.rb +++ b/lib/plum/client.rb @@ -166,6 +166,9 @@ module Plum if config[:tls] ctx = @config[:ssl_context] || new_ssl_ctx sock = OpenSSL::SSL::SSLSocket.new(sock, ctx) + if sock.respond_to?(:hostname=) + sock.hostname = @config[:hostname] || @host + end sock.sync_close = true sock.connect end @@ -228,9 +231,6 @@ module Plum ctx = OpenSSL::SSL::SSLContext.new ctx.ssl_version = :TLSv1_2 ctx.verify_mode = @config[:verify_mode] - if ctx.respond_to?(:hostname=) - ctx.hostname = @config[:hostname] || @host - end if ctx.respond_to?(:alpn_protocols) ctx.alpn_protocols = ["h2", "http/1.1"] end |