From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1ECA920FEA for ; Sun, 3 Jul 2016 23:18:56 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] openssl_client: wrap shutdown for graceful termination Date: Sun, 3 Jul 2016 23:18:56 +0000 Message-Id: <20160703231856.15120-1-e@80x24.org> List-Id: When we call shutdown on bad upstream responses, we need to ensure the TLS connection is terminated properly by calling SSL_shutdown and avoiding confusion on the client side. --- 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 @@ def trysendfile(io, offset, count) 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 -- EW