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.94.2) (envelope-from ) id 1qw8OK-009pma-Kk for pgsql-docs@arkaria.postgresql.org; Thu, 26 Oct 2023 21:59:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qw8OJ-006A8F-3N for pgsql-docs@arkaria.postgresql.org; Thu, 26 Oct 2023 21:59:47 +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.94.2) (envelope-from ) id 1qw8OI-006A64-Rh for pgsql-docs@lists.postgresql.org; Thu, 26 Oct 2023 21:59:46 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qw8OF-002zPH-JA for pgsql-docs@lists.postgresql.org; Thu, 26 Oct 2023 21:59:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description; bh=9X3sJBZ7m33HTBD5+yDyh1f3mMM2YFhiWmDDVPjcbJ0=; b=oq9h6 U9tykagZ65/koBguvld1FQdVhym0BsNo1yK4LFbp7DvynkYoIZHDglp12Vtiph5jaAO0Qhg/JHF2Y MohOvnyq2EvJliwfhngDRrs921vWahgoWvgeWzujcd03ueKRw9TjB7B8zsUZsglLi0XCgMVEx71tP N90WU4+hhSbW6qu3l3FvAPF4BIY5lzMyPMSkGpNCABaohT2q0Pb+iukPd4ZmLUqzKg7UEEbh0MOoH zUUnzal1La+vnrR2ho8wx1t8AYYalOIhURccA2V+9Nja8u4W+tpWVQsW0qOASH/uujm/fQYvik0kZ xCPNji/23dbgDVaRyr/oGcQuv3oWg==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1qw8OE-000uQI-0t; Thu, 26 Oct 2023 17:59:42 -0400 Date: Thu, 26 Oct 2023 17:59:42 -0400 From: Bruce Momjian To: andy@freeborough.com, pgsql-docs@lists.postgresql.org Subject: Re: 19.9. Secure TCP/IP Connections with SSL Message-ID: References: <169824864406.1769272.17694794243729037089@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <169824864406.1769272.17694794243729037089@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Oct 25, 2023 at 03:44:04PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/16/ssl-tcp.html > Description: > > There is no mention of key lengths on the manual page about SSL/TLS > connections even though there are restrictions. It probably depends on the > build which is why it's been omitted, but I think to help new people it > would be great to have a Note box that covers key lengths restrictions. It > came up on reddit today and while the following is in the error log.. > > FATAL: could not load server certificate file > "/etc/postgresql/16/main/server.crt": ee key too small > > It is amongst a chain of other messages and has a long line such that it > could be missed as it's truncated (though it should still have been spotted > of course). Regardless, I like the idea of all the things you need to do/be > mindful of being in the manual. It could be something like.. > > Note > Some builds of PostgreSQL specify a minimum key length for certificates to > enforce best-practices. If the key you use is does not meet or exceed this > minimum length PostgreSQL will fail to start. It's common practice to > require a key of at least length 2048. I think this is based on the SSL/TLS library in use which is why we don't mention it in our docs, e.g.: https://stackoverflow.com/questions/61626206/what-could-cause-dh-key-too-small-error -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.