Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZAh7m-0001jf-6Z for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2015 16:14:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZAh7l-0004cF-MZ for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2015 16:14:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZAh7j-0004a8-MI for pgsql-hackers@postgresql.org; Thu, 02 Jul 2015 16:14:03 +0000 Received: from mout.gmx.net ([212.227.15.15]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84) (envelope-from ) id 1ZAh7f-0003gy-Vj for pgsql-hackers@postgresql.org; Thu, 02 Jul 2015 16:14:03 +0000 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0Mb8MV-1ZUhkU3V7r-00KdwS for ; Thu, 02 Jul 2015 18:13:58 +0200 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id F08A3202BE for ; Thu, 2 Jul 2015 12:13:55 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Thu, 02 Jul 2015 12:13:55 -0400 X-Sasl-enc: A/rmkbEr6FZL4AjkHmnh0eKjr+fk3eURDXg/904gZHNt 1435853635 Received: from [192.168.1.146] (unknown [204.145.120.11]) by mail.messagingengine.com (Postfix) with ESMTPA id BDF27C0028F; Thu, 2 Jul 2015 12:13:55 -0400 (EDT) Message-ID: <55956342.9050408@gmx.net> Date: Thu, 02 Jul 2015 12:13:54 -0400 From: Peter Eisentraut User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andreas Karlsson , PostgreSQL-development Subject: Re: [PATCH] Reload SSL certificates on SIGHUP References: <556A6E8A.9030400@proxel.se> In-Reply-To: <556A6E8A.9030400@proxel.se> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:IZYSaoP0TAc5JBOan6qY8h8wLDHluTI0y8aCyf/Ul+QaHUuRonT EWAG2wvStXKq2RTKMYtL/sq1p6oDQEcDgqQ0hoordWQLjrKguCvaAWX+iF5tqoZJqGqTkpt ywu6vcDOVhYb1Ynl4xItZqF7ITVl7NM841xgM75Z6msiAG4IsbeyDiDkZEsWyY2M5XrijTA VYS0RYjYLlkYoC3RVskKA== X-UI-Out-Filterresults: notjunk:1;V01:K0:GxqcYAIQVks=:t42n14xIE9H5DVe3zy/MH1 dvWDSWGkZy0WBvt1L3Zo7TFczExZTyal2hm21wyxYfdqltOh/Ljm2t7209uqtDSI/77P+b1LW v7362nWEvQjWQEC5pavddzwa04uEJ9bvE1Otko/To/WuRdOAp3zpeiVM4YFTjtP1OHlx5Cmyc OA0XaIIa0R3VhMxj8FVAj3ejLDI4gpUGVe7+UY4n96rPgLHvluWZBCJDgP6SxjOpjuNekERDD 6R0Lo4md9Ici53Jx5CoR3+L5CDCPjOBzxGvZ+L3Bd2kkrolawN8YUpUGnC0waWxyFCG+Z9z4H BSk8sIjKhbnPYhaSsW1S6SdUIPO4PDvVMXMsTbxOcadQ4wQr+1W+Q7JDFSOKgvr+oEl0WZdAY Vl1SQwYMhFjJpYRaNtzE+ybOVOSfQqs3uYDIZ3cVxe9ocTtbjOJBMTMdYACj3xBk7Yt1VaSNZ vLmS8gsjUkm/JLUHos0WP1vpqGhKR5jc0iXw0po+W9rYeEY3s5lP1nWh5mIN+IxOSa00ZQ4iA AsiHR934bUD1a3aGxkOgsqJ66ua2gsP3j7RGDxhLi7l+w7hdI65hVT0uMeI+/vOXhyHkOrHqZ E5s8dHOHEKS/NRy7xXNZ/sRCzZFBu625zyXflFX3i4+0RhdcLaGtCL2WvQsDr185npAWtmprH OIc9Kukwp+YOIR/QYFr5PVrqj4C/h0DYW8P2VTtlX4Io145aZOTj2ubdtCWoftrwWcKM= X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 5/30/15 10:14 PM, Andreas Karlsson wrote: > I have written a patch which makes it possible to change SSL > certificates (and other SSL parameters, including the CRL) without > restarting PostgreSQL. In fact this patch also makes it possible to turn > on or off ssl entirely without restart. It does so by initializing a new > SSL context when the postmaster receives a SIGHUP, and if the > initialization succeeded the old context is replaced by the new. I think this would be a useful feature, and the implementation looks sound. But I don't like how the reload is organized. Reinitializing the context in the sighup handler, aside from questions about how much work one should do in a signal handler, would cause SSL reinitialization for unrelated reloads. We have the GUC assign hook mechanism for handling this sort of thing. The trick would be that when multiple SSL-related settings change, you only want to do one reinitialization. You could either have the different assign hooks communicate with each other somehow, or have them set a "need SSL init" flag that is checked somewhere else. > There was some previous discussion[1] on the mailing list about what the > proper context should be for the SSL parameters, but as far as I can > tell the discussion never reached a conclusion. I have changed the SSL > GUCs to PGC_SIGUP since I felt that was the closest to the truth, but it > is not a perfect fit (the backends wont reload the SSL context). Should > we add a new context for the SSL GUCs? I think PGC_SIGHUP is fine for this. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers