Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6cXk-00033G-Bb for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 15:54:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6cXi-0006a5-QT for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 15:54:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6cXg-0006Ul-Vn for pgsql-general@lists.postgresql.org; Tue, 25 Feb 2020 15:54:42 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6cXa-0004K0-Be for pgsql-general@postgresql.org; Tue, 25 Feb 2020 15:54:39 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3609521FFC; Tue, 25 Feb 2020 10:54:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 25 Feb 2020 10:54:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=A eo7pOlk9zDscBgKXQhzq8ZtrIUl82k8M07hauKqCgE=; b=UEWeRVVoMHA9tFFkl MYzu7/OXozMc7Vlypad5AA3mpppjTC35OhwNsq+zA/g1zzfpIunCFhq623i8ywKv zLNet7owMb20GX+m1INX8ZwgG0fIaAYZ8ByLhXqpKVwpu4AX0UIjD/O0ghjxAiDE d8JcRcb4F6YV5Dhl45kQp9+Up60dDn4sQNlzxWxmMV/s9ik+Gyj0ger49bQDEgAL Gp1ww3RBw5f14aKs5nlzGATz3p9x917gF5VTHSD+M3a8A33E3Nq3cL1eZddjAtC0 WQPEbKOAmI0SQwvVsW2emQm3GQUOOFc8bF1jRkXffPqlAh8UvMLiphwy5aDEyYtl JBsig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=fm2; bh=Aeo7pOlk9zDscBgKXQhzq8ZtrIUl82k8M07hauKqC gE=; b=NTWhhwfU7WjNadR98wTi6dgmMreXgQlPDiQzxM2aIfu3egtSYxEOggLWV 1Grbiru4dxicI+/OKpi/6gN8UAAaH0nn8Qt9Q3o+B1jplIBN8a87kION92ZmBVNS eigIxEhN8Sx7DFL48V8QHS5qnIdTs502q/a0JhzveyYfaNxPgsNhx6fgrkQE1BeG 2/xOY3jy9U7+DFGP2iRctO2NZKMVZu87PgDKx3Na6WiVzHmBvpNjF1ZzOS+iuI7z +5bO98N2M0nh90tMhY+2XfJLgiryzKIJ2Uhr8CSc9L+POWlWBa1YhmKX7AaNfI9B fx1iBOmYYm24r43lLj/sFZEYndvYA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrledvgdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpedtrddtrddtrddtpdiggidrgiiggienucfkphepjedurddvuddv rdduvdelrdduleefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 9014F3280063; Tue, 25 Feb 2020 10:54:32 -0500 (EST) Subject: Re: LDAP with TLS is taking more time in Postgresql 11.5 To: Mani Sankar References: <319e70c3-cd99-8bf9-260d-49064ba402c5@aklaver.com> Cc: pgsql-general From: Adrian Klaver Message-ID: <1e9458a5-6f83-7715-3b48-a1bfae35ca72@aklaver.com> Date: Tue, 25 Feb 2020 07:54:31 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/24/20 9:07 PM, Mani Sankar wrote: Please reply to list also. Ccing list. > Hi Adrian, > > Thanks for replying. Below are the requested details. > > ################ Configuration in 9.4 PG Version > > local all all ldap ldapserver=XXXXXXXXXXXXXX ldapport=3268 > ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host all someuser xx.xx.xx.xx/32 ldap ldapserver=XXXXXXXXXXXXXXX > ldapport=3268 ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host all someuser ::1/128 ldap ldapserver=XXXXXXXXXXXXXXX ldapport=3268 > ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host all all 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > host all all ::1/128 ldap ldapserver=XXXXXXXXXXXXXXX ldapport=3268 > ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host replication someuser 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > host replication someuser 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > ############ Configuration in 11.5 Version. > > local all all ldap ldapserver=XXXXXXXXXXXXXXX ldapport=3268 > ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host all someuser xx.xx.xx.xx/32 ldap ldapserver=XXXXXXXXXXXXXXX > ldapport=3268 ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host all someuser ::1/128 ldap ldapserver=XXXXXXXXXXXXXXX ldapport=3268 > ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host all all 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > host all all ::1/128 ldap ldapserver=XXXXXXXXXXXXXXX ldapport=3268 > ldapprefix="ADS\" ldapsuffix="" ldaptls=1 > > host replication someuser 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > host replication someuser 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > host replication someuser 0.0.0.0/0 ldap > ldapserver=XXXXXXXXXXXXXXX ldapport=3268 ldapprefix="ADS\" ldapsuffix="" > ldaptls=1 > > host    replication     replicator  XXXXXXXXXXXXX/22        md5 > > host    replication     replicator  1XXXXXXXXXXXX/22        md5 > > Linux Version: Red Hat Enterprise Linux Server release 6.10 (Santiago) > > Server Installation is Source code installation. Custom build for our > environment. > > Authentication logs from PG 11.5: > > 2020-02-24 00:00:15 MST [25089]: > application=[unknown],host=xx.xx.xxx.xx(55742),user=[unknown],db=[unknown],state=00000 > LOG:  connection received: host=xx.xx.xxx.xx port=55742 > > 2020-02-24 00:00:16 MST [25090]: > application=[unknown],host=xx.xx.xxx.xx(55748),user=[unknown],db=[unknown],state=00000 > LOG:  connection received: host=xx.xx.xxx.xx port=55748 > > 2020-02-24 00:00:16 MST [25092]: > application=[unknown],host=xx.xx.xxx.xx(55765),user=[unknown],db=[unknown],state=00000 > LOG:  connection received: host=xx.xx.xxx.xx port=55765 > > 2020-02-24 00:00:16 MST [25093]: > application=[unknown],host=xx.xx.xxx.xx(55770),user=[unknown],db=[unknown],state=00000 > LOG:  connection received: host=xx.xx.xxx.xx port=55770 > > 2020-02-24 00:00:17 MST [25090]: > application=[unknown],host=xx.xx.xxx.xx(55748),user=Someuser,db=test_db,state=00000 > LOG:  connection authorized: user=Someuser database=test_db > > 2020-02-24 00:00:17 MST [25089]: > application=[unknown],host=xx.xx.xxx.xx(55742),user=Someuser,db=test_db,state=00000 > LOG:  connection authorized: user=Someuser database=test_db > > 2020-02-24 00:00:17 MST [25092]: > application=[unknown],host=xx.xx.xxx.xx(55765),user=Someuser,db=test_db,state=00000 > LOG:  connection authorized: user=Someuser database=test_db > > 2020-02-24 00:00:17 MST [25093]: > application=[unknown],host=xx.xx.xxx.xx(55770),user=Someuser,db=test_db,state=00000 > LOG:  connection authorized: user=Someuser database=test_db > > Authentication logs from PG 9.4: > > 2020-02-17 22:40:01 MST [127575]: > application=[unknown],host=xx.xx.xx.xx(39451),user=[unknown],db=[unknown] LOG: > connection received: host=xx.xx.xx.xx port=39451 > > 2020-02-17 22:40:01 MST [127575]: > application=[unknown],host=xx.xx.xx.xx(39451),user=Someuser,db=test_db > LOG:  connection authorized: user=Someuser database=test_db > > 2020-02-24 21:57:44 MST [117472]: > application=[unknown],host=xx.xx.xx.xx(58500),user=[unknown],db=[unknown] LOG: > connection received: host=xx.xx.xx.xx port=58500 > > 2020-02-24 21:57:44 MST [117472]: > application=[unknown],host=xx.xx.xx.xx(58500),user=Someuser,db=test_db > LOG:  connection authorized: user=Someuser database=test_db > > 2020-02-24 21:58:27 MST [117620]: > application=[unknown],host=xx.xx.xx.xx(58520),user=[unknown],db=[unknown] LOG: > connection received: host=xx.xx.xx.xx port=58520 > > 2020-02-24 21:58:27 MST [117620]: > application=[unknown],host=xx.xx.xx.xx(58520),user=Someuser,db=test_db > LOG:  connection authorized: user=Someuser database=test_db > > 2020-02-24 21:58:31 MST [117632]: > application=[unknown],host=xx.xx.xx.xx(58524),user=[unknown],db=[unknown] LOG: > connection received: host=xx.xx.xx.xx port=58524 > > 2020-02-24 21:58:31 MST [117632]: > application=[unknown],host=xx.xx.xx.xx(58524),user=Someuser,db=test_db > LOG:  connection authorized: user=Someuser database=test_db > > We also have a local .ldaprc file with below entry > > TLS_REQCERT allow > > > On Tue, Feb 25, 2020 at 2:28 AM Adrian Klaver > wrote: > > On 2/24/20 11:50 AM, Mani Sankar wrote: > > Hi All, > > > > We have recently upgraded our postgres servers from 9.4 version > to 11.5 > > version. Post upgrade we are see delay in authentication. > > > > Issue is when we are using ldaptls=1 the authentication takes 1 > second > > or greater than that. But if I disable ldaptls it's getting > > authenticated within milliseconds. > > > > But in 9.4 even if I enable ldaptls it's getting authenticated > within > > milliseconds any idea why we are facing the issue? > > This is going to need a good deal more information: > > 1) OS the server is running on and did the OS or OS version change with > the upgrade? > > 2) How was the server installed from packages(if so from where?) or > from > source? > > 3) The configuration for LDAP in pg_hba.conf. > > 4) Pertinent information from the Postgres log. > > 5) Pertinent information from the system log. > > > > > Regards, > > Mani. > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com