Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLTuV-00004z-11 for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Sep 2021 17:20:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLTuR-000244-Nk for pgsql-bugs@arkaria.postgresql.org; Wed, 01 Sep 2021 17:20:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLTuR-0001yV-0x for pgsql-bugs@lists.postgresql.org; Wed, 01 Sep 2021 17:20:23 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLTuK-00084K-Ar for pgsql-bugs@lists.postgresql.org; Wed, 01 Sep 2021 17:20:22 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5C06B5C01B9; Wed, 1 Sep 2021 13:20:15 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute1.internal (MEProxy); Wed, 01 Sep 2021 13:20:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=Q3LAaPyzVvNa+nKC0Kd1M8PzWWCy/dd /IWpG0cyMZxs=; b=liZsXdisLStWMdFB37wTTV/uhP6mY0LOFfvqTzMTQoUqbgP cJTDaaZyDmlgbU89oWp4h6hBjaNDsi+2D1Vw3LSjZmKDSJexuNlJOaMPSmbSg8i+ RVc4ktlkYVt/1Hw59eBG6wMFpEavQ/FePkqGQcd5AOhJ9giUw5TJiIP8WkbRq7iV IKcYmHlaZmZtAxB7s9yPjCbpiYTWmylotJQr8jdqVJ0598VSEujJ+fxPJYyw/Lsx QCNbGlCVkbG6qodmG7YN0U13qHRbqeZtxwgtcb3rxPN5ilh5bKl74Rk/6iCZ8TF4 NhH0wtBb1aql6IVeEwm6RJwKciJntKz9iHDRkjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Q3LAaP yzVvNa+nKC0Kd1M8PzWWCy/dd/IWpG0cyMZxs=; b=FSSwIMheVsnl4eGYYY027n w0f9cB5uE/k5mUKLEqAMhAZ98ZIQPlFIi2K8pdUWk4zPF3JAmb8np9armDbjcR9V iV6h4Uy4oWo6hQdZfPPwRPzy/fMBj82RuMoG9v+AU9w+r1uRtGDB/4ZhlopM8e7A SZEmXkdCEWn6AmpHbMvDCboNpFarWS8dAS43QWTeKvpZb9wnIevyhGrzhHx16TGD +HQGeOQfFz3JnQymjJ4aFrmVmyrlc9NdEkVsdGE6jHPS7IzZX5jtD5iA4UKorRcj NuXpXUwrW6JpjR4noSe3Ui8ty/ZpZ6+2xEW9BQwErsqczKuwlIGXr8yCrqkZe3cQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvfedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedfgfhu lhgvrhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecugg ftrfgrthhtvghrnhepjeethfeuvdfgffdtteevudeftdejueffkeelveekhfevkeegleef hfejhedtjeegnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegv uhhlvghrthhordgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id AC2AF51C0061; Wed, 1 Sep 2021 13:20:14 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1126-g6962059b07-fm-20210901.001-g6962059b Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Wed, 01 Sep 2021 14:19:49 -0300 From: "Euler Taveira" To: "Yongqian Li" , pgsql-bugs@lists.postgresql.org Subject: Re: Unexpected behavior from using default config value Content-Type: multipart/alternative; boundary=87c80b1b04404a51bfdd8fd7539b6b72 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --87c80b1b04404a51bfdd8fd7539b6b72 Content-Type: text/plain On Sat, Aug 28, 2021, at 10:04 PM, Yongqian Li wrote: > I encountered this problem while I was trying to enable SSL on my postgresql server. Since I was satisfied with the default values for the "ssl_key_file" and "ssl_cert_file" settings I chose to not configure them -- I simply turned on "ssl" and copied over the files to the default locations. However, I kept getting certificate errors on the client. Examining the certificate sent by the server using `openssl s_client -starttls postgres -connect "$HOSTNAME:5432"` revealed that the server was sending some auto-generated cert instead of the one in "server.crt". Setting the "ssl_key_file" and "ssl_cert_file" settings explicitly to their default value fixed the problem. From the documentation I would expect that missing values for config keys would fallback to their default value; instead it seems that postgresql has some undocumented fallback behavior in this case. You didn't provide enough information about this issue. Start with the following query: SELECT name, setting, SOURCE, bootval, resetval, sourcefile, sourceline, pending_restart FROM pg_settings WHERE name ~ '^ssl'; What's your Postgres version? What's your OS? Are you using a package? Which one? Do the server certificate and private key exist in the server's data directory? ls -la $PGDATA/server.* -- Euler Taveira EDB https://www.enterprisedb.com/ --87c80b1b04404a51bfdd8fd7539b6b72 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Sat, Aug 28,= 2021, at 10:04 PM, Yongqian Li wrote:
I encountered this problem = while I was trying to enable SSL on my postgresql server. Since I was sa= tisfied with the default values for the "ssl_key_file" and "ssl_cer= t_file" settings I chose to not configure them -- I simply turned on "ss= l" and copied over the files to the default locations. However, I kept g= etting certificate errors on the client. Examining the certificate = sent by the server using `openssl s_client -starttls postgres -connect "= $HOSTNAME:5432"` revealed that the server was sending some auto-generate= d cert instead of the one in "server.crt". Setting the "ssl_key_file" an= d "ssl_cert_file" settings explicitly to their default value f= ixed the problem. From the documentation I would expect that missin= g values for config keys would fallback to their default value; instead = it seems that postgresql has some undocumented fallback behavior in this= case.
You didn't provide enough inform= ation about this issue. Start with the
following query:

SELECT name,
   =     setting,
     =   SOURCE,
       bootva= l,
       resetval,
       sourcefile,
&nb= sp;      sourceline,
  =      pending_restart
FROM pg_settings<= br>
WHERE name ~ '^ssl';

What's y= our Postgres version? What's your OS? Are you using a package? Which
=
one?

Do the server certificate a= nd private key exist in the server's data directory?

<= /div>
ls -la $PGDATA/server.*


--
Euler Taveira

--87c80b1b04404a51bfdd8fd7539b6b72--