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 1j6emo-0007KZ-HZ for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 18:18:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6emn-00066f-AT for pgsql-general@arkaria.postgresql.org; Tue, 25 Feb 2020 18:18:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6eml-00066L-Ci for pgsql-general@lists.postgresql.org; Tue, 25 Feb 2020 18:18:25 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6emg-00073D-Ca for pgsql-general@postgresql.org; Tue, 25 Feb 2020 18:18:22 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3E5F52202C; Tue, 25 Feb 2020 13:18:15 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 25 Feb 2020 13:18:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=q mFLfT4uYWoXjAXBmKAOH5wKKVJsUzJT9VfPr6QPfLI=; b=LONyPGoP3cYhNeRpf bcG9ZQqb/SpOIF7BqSOpji9bNgXEaLSiOmw9ityJwbPUGfKplaRrC83TjRGPy4aJ nb73tNGxAq9iKmUAJevMk2YszPcnC+7qUrG8EFxcC0iHpWDp42gq3g770d/uJ3Ok EM+z6n+8P+5stZZTtKwg35tGJz8lpcU4+dQ4+Frvs+fM5Hnv6L7zAKpSyWXzKMUy 5VtV37wAxflFAN0151rRC6BT0yw0wWZ3e8/rurESmBjpHzGHQMOlMxcFtO75eBHp 9ytETLdyAEqP1sp4p1e5IuF6IafoCIDZOqsLnFI7pzDtiVDjB2ovBDDSLKLDACqL Phbrw== 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=qmFLfT4uYWoXjAXBmKAOH5wKKVJsUzJT9VfPr6QPf LI=; b=jyXslEMG6/j4cGJeuje+m3GiXde8U2/f5iedWpElVwD4LJzAS2kheqJ3D nLu8AgAh9aSnqwqPQyJieS1BJt20jrdWqoD+je/lUXdzoy51J1pae5lfaaYUtfSa 3rKX+gNO6QvayMJcwoosSo5EbRAOmzBfrHSKlEHXBVJwpAze/wny4/SiG4p6iHY1 uk5CUPil10HmhNj3Bs4EoW/f47Ybxtw78R/0i9HjUCWxzLSo3sEHOLrnKZARXad3 f5XP/upLRMlrmPWTD1f+6+PAKEMaxuCNNHaALcv8BSBihsyVbOaueZ7JVF+TA6E6 wpYlztT4LXu6aTuhzLhI8ac8+nmEQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrledvgdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinheptddrtddrtddrtddpgiigrdiggiignecukfhppeejgedrleeg rdejfedrvddvvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (unknown [74.94.73.222]) by mail.messagingengine.com (Postfix) with ESMTPA id A816E3060F09; Tue, 25 Feb 2020 13:18:14 -0500 (EST) Subject: Re: LDAP with TLS is taking more time in Postgresql 11.5 To: Mani Sankar Cc: pgsql-general References: <319e70c3-cd99-8bf9-260d-49064ba402c5@aklaver.com> <1e9458a5-6f83-7715-3b48-a1bfae35ca72@aklaver.com> From: Adrian Klaver Message-ID: Date: Tue, 25 Feb 2020 10:18:13 -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/25/20 10:08 AM, Mani Sankar wrote: > Hi Adrian, > > Should I want to try this configuration? I thought you where already using this configuration? Are the 9.4 and 11.5 instances are on the same machine and/or network? In other words is ldapserver=XXXXXXXXXXXXXXX pointing at the same thing? > > Regards, > Mani. > > On Tue, 25 Feb, 2020, 9:24 pm Adrian Klaver, > wrote: > > 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 > -- Adrian Klaver adrian.klaver@aklaver.com