From b01adb35fddb5d3b9736d54d69c4304fbdfc599b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 3 Jul 2016 23:18:56 +0000 Subject: openssl_client: wrap shutdown for graceful termination When we call shutdown on bad upstream responses, FD limits, or server termination, we need to ensure the TLS connection is terminated properly by calling SSL_shutdown and avoiding confusion on the client side (or violating TLS specs!). --- lib/yahns/openssl_client.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/yahns/openssl_client.rb b/lib/yahns/openssl_client.rb index cd7d210..f896acd 100644 --- a/lib/yahns/openssl_client.rb +++ b/lib/yahns/openssl_client.rb @@ -93,6 +93,10 @@ module Yahns::OpenSSLClient # :nodoc: rv end + def shutdown # we never call this with a how=SHUT_* arg + @ssl.sysclose + end + def close @ssl.close # flushes SSLSocket super # IO#close -- cgit v1.2.3-24-ge0c7