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 A833E1F955 for ; Tue, 2 Aug 2016 19:57:48 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] doc: add session cache usage to OpenSSL example Date: Tue, 2 Aug 2016 19:57:48 +0000 Message-Id: <20160802195748.18989-1-e@80x24.org> List-Id: Sometimes, one process is all you need :> Fwiw, I am also experimenting with the following in my yahns.conf.rb file: scache_stats = lambda do |env| s = ctx.session_cache_stats.inspect << "\n" [200, [%W(Content-Length #{s.size}), %w(Content-Type text/plain)], [s]] end app(:rack, scache_stats, preload: true) do listen "unix:/tmp/yahns-scache.#$$.sock" end Which allows me to get stats based on the master PID (not worker): printf 'GET / HTTP/1.0\r\n\r\n' | socat - UNIX:/tmp/yahns-scache.$PID.sock --- Documentation/yahns_config.pod | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/yahns_config.pod b/Documentation/yahns_config.pod index d8c6801..c519256 100644 --- a/Documentation/yahns_config.pod +++ b/Documentation/yahns_config.pod @@ -451,6 +451,9 @@ An example which seems to work is: # but disable client certificate verification as it is rare: ssl_ctx.set_params(verify_mode: OpenSSL::SSL::VERIFY_NONE) + # Built-in session cache (only works if worker_processes is nil or 0) + ssl_ctx.session_cache_mode = OpenSSL::SSL::SSLContext::SESSION_CACHE_SERVER + app(:rack, "/path/to/my/app/config.ru") do listen 443, ssl_ctx: ssl_ctx end -- EW