Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6BjS-0042Vf-22 for pgpool-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 18:16:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6BjQ-00BFDc-2E for pgpool-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 18:16:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6BjQ-00BFDU-1b for pgpool-hackers@lists.postgresql.org; Fri, 27 Mar 2026 18:16:28 +0000 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w6BjN-00000001Wc4-3yHB for pgpool-hackers@lists.postgresql.org; Fri, 27 Mar 2026 18:16:28 +0000 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5a299cba953so2699980e87.2 for ; Fri, 27 Mar 2026 11:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774635384; cv=none; d=google.com; s=arc-20240605; b=BBZFL5injIOawSXtPztOyXCvzGvH55GuqEKMxDPvapRQ/22z2WdtaVtw2gOQoJxnDA 0I3iS5n1kyShTYq5FPEAp3GcB23/JyMVZb7ahxd5NUsnHXD4nD7ISwoasS39lEcsUu0l le0VN3Pbyl7j66FsQxXg5wUoibonNq9QKAN/A8KcBOtWUUCM99rw6eJHq6QyoJUY/LkT kMBNS0muVmp8Ot+rkgCtPm5nP+/JfqdsKdQlNLpcWQ4QRx9iO786UQ1PnR6WcMg1tosz Hu67bUnh0y2FotsHaD8haoLbho3Tatny3Nhg9XzOoLVEf2zUN3apX7TZU1sdClNeErtP 1vYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=NUJp0kJMAGJVhuUG2+aBGS/AOH/u5SAgDak+eHUTsq8=; fh=m3oiE62fRN5J1XaE+5vpHZRIgCyFefxVI0mFw3d8yxA=; b=h8pC1I57gsAbGeWEdE16FPkh+N42ucM0kVDBzfcmV7t4QHwec5oTvbOnnABjQGDWRa O+fa9NWfCI+zfWZ62UrwtgrsqicIiQRnWRKZWK561HlUm4ElDBzBSRTk4JOcMSDwRcdW kK8kbw2Ew3t4wWvnA36y/ZKLEL6HlrlJHT2wmurKS8HVg4Z3Tg/Xc3B81zKeecrZ+ea9 Qar25r/+4tCJxIVNB2rKHmMv3pwp8V5Mv2nYpbbdhEwDzpxv+OTKFWkCiEtqN4RJvXDx NTN/ZuzPTmiH+cvg2cS0RhqRKKUkRM4PR8cAnPiuxWQ9soYrSCFfxuLGR/87LgnP9pkb JPng==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774635384; x=1775240184; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NUJp0kJMAGJVhuUG2+aBGS/AOH/u5SAgDak+eHUTsq8=; b=SVISB7oCwPPhxIlRVVdbdEAvAYA/gBMb1i3JFQBgKm46MhRDAgrF1kSkhmBnjWY6Xu a3CPO1wgJ13NEPd90+2z2faZN7qL30Ae9/ZUzS8Aee1ulBbtFdUTLbRewtkMhGGTVSRc 6oNKKBx2UmKwHDNjsTrxJ5QyWPd5sc7OCUVuJLgYEY8JzEPaR55OMgpGcMD1s7DNq66s jSjU+naQbo86S8v7pS+DdsGjZ1Q5o9r19t2u5ZuTBvFW8lxnO1kP0u6G0+WC8cxBWRXF w+2ctJ4J7LlpU8Nnw6BN49nbiIJWc0Mp4pgQGOmUsYgFegazgvMdZw6NHRxzW38qzcFW WbOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774635384; x=1775240184; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NUJp0kJMAGJVhuUG2+aBGS/AOH/u5SAgDak+eHUTsq8=; b=fU4R7NFtis52IwHPIWTbrrPLy/HsCs3GuygAUYxsw/T2ypxyMsigVDKczT4IR/Z82T MoDqgd+MCbv7s2sy68AHorZ654gG1ow5Uca87ygrveNFVXdBR/+vcGD02CCEUv7vxjZH 8IO3rEmBTFoDU6d5rcQ28Nn4VqCc+yWYBhXNs0daxllQ77D0mhbTwqUK+jgMrw88udeu 6IA7Jh+k9AVfSoH/GqikAHOuzWSVE0HTU5Zr+31ytrbikKrunOfKYB3B3O9zrA1hhtzC tA5DjbaM7boTkCm4vtJ1eHcbDkHXM6HzK3oat1pI/Y5Fl9i/iulk5Xxx6n/yj83mQ+2V Wh5g== X-Gm-Message-State: AOJu0YyQWxSggpaLGm77pbWL9Vfkk0+JvbF1Z9W6p2HSmfjQnTcfu8wq ++z1W5mpHLjNh65I66eLFM6hjpiuRrjEq1sGY9uVzszoYNjX9GymUXSrqps34qcsGnUX2WPTwCB /mLJQQvsQg9VcaAD1N+JXuQlMkaqxLIfyWUM+ X-Gm-Gg: ATEYQzw58QGFbQigxhwDigDtT+i3gHtVJpFeKGVfmOrmvKN/wcz0Ba4QcaLyHlaLaVp JMIzh8JeIybDukJ8HwpkZ7aluHzY7XSHVgvQdPD2fjHcSaaGbLwLm4fZKmstqOg7Okoaxjq9hpw B6WOaZWEuIP1bARYVPTVY4JfRJpk8DOLXtuqhqQg+rHRoj0daePEIfyFeu8luU+XC76LopOBeeq vbTFXcwhKzKNpfQk1bDv6eqE9g2dJhNcJlfjgRKtUXmuG/X4++AdG3fF1Y6gw2NJP6EyS1RNXt2 SNGpKA== X-Received: by 2002:a05:6512:2252:b0:5a2:a3da:fada with SMTP id 2adb3069b0e04-5a2ab7e8e4dmr1477779e87.5.1774635383815; Fri, 27 Mar 2026 11:16:23 -0700 (PDT) MIME-Version: 1.0 References: <20260319.192225.349123033503761335.ishii@postgresql.org> <20260326.170716.601660341897872041.ishii@postgresql.org> <20260326.191902.1769703442358463290.ishii@postgresql.org> In-Reply-To: <20260326.191902.1769703442358463290.ishii@postgresql.org> From: Bob Ross Date: Fri, 27 Mar 2026 19:16:12 +0100 X-Gm-Features: AQROBzBoloKD_2aIIu5eSjBas1NmNX2hd0t2LYERgGMYq6-dMiLGYh6EEH7X1V8 Message-ID: Subject: Re: Rotate SSL certificates on reload (SIGHUP) without restart To: Tatsuo Ishii Cc: pgpool-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000a8824d064e057f7f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a8824d064e057f7f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tatsuo, I believe no additional changes are needed for healthcheck and streaming replication check. My patch focuses on the frontend-accept path, where SSL_ServerSide_init() maintains a process-wide cached SSL_frontend_context reused across incoming TLS handshakes, and therefore must be explicitly refreshed on reload. In contrast, the health check (src/main/health_check.c) and the SR check worker (src/streaming_replication/pool_worker_child.c) establish outgoing connections to PostgreSQL backends via pool_ssl_negotiate_clientserver(). This invokes init_ssl_ctx() for each new connection, creating a fresh SSL_CTX and reading SSL-related settings (ssl_cert, ssl_key, ssl_ca_cert, etc.) directly from pool_config at connection time. There is no long-lived SSL context to refresh in these processes. Given that the SSL configuration parameters are now marked as CFGCXT_RELOAD in src/config/pool_config_variables.c, a SIGHUP causes both processes to reload pool_config via their respective reload_config() functions. As a result, subsequent outgoing backend connections will naturally pick up the updated certificate settings. Please let me know what you think. Best regards, Bob On Thu, Mar 26, 2026 at 11:19=E2=80=AFAM Tatsuo Ishii wrote: > Hi Bob, > > > Thank you for the patch! I will look into the patch. > > I skimmed through the patch. You changed main.c and child.c to call > SSL_ServerSide_init() so that they reload new SSL parameters. However, > in Pgpool-II there are two more places which could use SSL connection > to PostgreSQL server: health check and streaming replication check. I > suspect they need to call SSL_ServerSide_init() while reloading the > config file. What do you think? > > Regards, > -- > Tatsuo Ishii > SRA OSS K.K. > English: http://www.sraoss.co.jp/index_en/ > Japanese:http://www.sraoss.co.jp > --000000000000a8824d064e057f7f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tatsuo,

I believe no additional changes are= needed for healthcheck and streaming replication check.

My patch fo= cuses on the frontend-accept path, where SSL_ServerSide_init() maintains a = process-wide cached SSL_frontend_context reused across incoming TLS handsha= kes, and therefore must be explicitly refreshed on reload.

In contra= st, the health check (src/main/health_check.c) and the SR check worker (src= /streaming_replication/pool_worker_child.c) establish outgoing connections = to PostgreSQL backends via pool_ssl_negotiate_clientserver(). This invokes = init_ssl_ctx() for each new connection, creating a fresh SSL_CTX and readin= g SSL-related settings (ssl_cert, ssl_key, ssl_ca_cert, etc.) directly from= pool_config at connection time. There is no long-lived SSL context to refr= esh in these processes.

Given that the SSL configuration parameters = are now marked as CFGCXT_RELOAD in src/config/pool_config_variables.c, a SI= GHUP causes both processes to reload pool_config via their respective reloa= d_config() functions. As a result, subsequent outgoing backend connections = will naturally pick up the updated certificate settings.

Please let = me know what you think.

Best regards,
Bob



On Thu, Mar 26, 2026 at 11:19=E2=80=AFAM = Tatsuo Ishii <ishii@postgresql.o= rg> wrote:
http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
--000000000000a8824d064e057f7f--