about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/yahns/http_client.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index d8154a4..fd97624 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -298,10 +298,18 @@ class Yahns::HttpClient < Kgio::Socket # :nodoc:
     when Unicorn::HttpParserError # try to tell the client they're bad
       400
     else
+      n = 500
+      case e.class.to_s
+      when 'OpenSSL::SSL::SSLError'
+        if e.message.include?('wrong version number')
+          n = nil
+          e.set_backtrace([])
+        end
+      end
       Yahns::Log.exception(@hs.env["rack.logger"], "app error", e)
-      500
+      n
     end
-    kgio_trywrite(err_response(code))
+    kgio_trywrite(err_response(code)) if code
   rescue
   ensure
     shutdown rescue nil