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 1uOIf4-000yVv-CD for pgsql-bugs@arkaria.postgresql.org; Sun, 08 Jun 2025 16:14:18 +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 1uOIf1-00237y-OL for pgsql-bugs@arkaria.postgresql.org; Sun, 08 Jun 2025 16:14:16 +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 1uOIf1-00235i-FP for pgsql-bugs@lists.postgresql.org; Sun, 08 Jun 2025 16:14:16 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uOIez-000uRb-38 for pgsql-bugs@lists.postgresql.org; Sun, 08 Jun 2025 16:14:15 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 558GE79q197872; Sun, 8 Jun 2025 12:14:07 -0400 From: Tom Lane To: Andrus cc: pgsql-bugs@lists.postgresql.org Subject: Re: tlsv1 alert unknown ca error on cert authentication In-reply-to: <2d836545-781e-4340-9216-687b51036a71@hot.ee> References: <2d836545-781e-4340-9216-687b51036a71@hot.ee> Comments: In-reply-to Andrus message dated "Sun, 08 Jun 2025 15:21:40 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <197870.1749399247.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 08 Jun 2025 12:14:07 -0400 Message-ID: <197871.1749399247@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrus writes: > Observed: >>> pg_dump: error: connection to server at "localhost" (::1), port 5432 >>> failed: SSL error: tlsv1 alert unknown ca > Postgres log contains: >>> [unknown] ::1 [unknown] LOG:  could not accept SSL connection: >>> certificate verify failed [unknown] ::1 [unknown] DETAIL: Client >>> certificate verification failed at depth 0: self-signed certificate. Hm. This example works fine for me on RHEL8. Evidently your openssl installation is set up to reject self-signed certificates by default. I note that in my installation, /etc/pki/tls/openssl.cnf contains [ req ] ... x509_extensions = v3_ca # The extensions to add to the self signed cert ... [ v3_ca ] # Extensions for a typical CA ... # Key usage: this is typical for a CA certificate. However since it will # prevent it being used as an test self-signed certificate it is best # left out by default. # keyUsage = cRLSign, keyCertSign Perhaps in your configuration file, that option is active? regards, tom lane