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 1oXicK-0000nY-OD for pgsql-general@arkaria.postgresql.org; Mon, 12 Sep 2022 12:32:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXiTU-0004TE-UF for pgsql-general@arkaria.postgresql.org; Mon, 12 Sep 2022 12:23:40 +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 1oXiTU-0004T4-1v for pgsql-general@lists.postgresql.org; Mon, 12 Sep 2022 12:23:40 +0000 Received: from mx0c-001a4c01.pphosted.com ([67.231.158.153]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXiTQ-0001fa-7S for pgsql-general@lists.postgresql.org; Mon, 12 Sep 2022 12:23:38 +0000 Received: from pps.filterd (m0075701.ppops.net [127.0.0.1]) by mx0c-001a4c01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28CAvZ4o018462 for ; Mon, 12 Sep 2022 08:23:34 -0400 Authentication-Results: ppops.net; spf=fail smtp.mailfrom=sebastien.flaesch@4js.com; dkim=pass header.s=selector2-ourvolaris-onmicrosoft-com header.d=ourvolaris.onmicrosoft.com Received: from eur02-he1-obe.outbound.protection.outlook.com (mail-he1eur02lp2058.outbound.protection.outlook.com [104.47.5.58]) by mx0c-001a4c01.pphosted.com (PPS) with ESMTPS id 3jgpeth9t4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 12 Sep 2022 08:23:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EkqcZIHbdew7gyxglES2mVuQ0G27hAAoGXwagXQCjfHH69m3JndFXgrCEK55c9pR9OkDQLPoPQq1rU/GcHyM7U3gvrkOoyumZTu4Cm0Ea/yjQbQf+JHhMIuI93TpOc89ZFUBKnGq+4UPxfp8O1/BLFR3B6RGbX41ra4eA3S53+OwOxuBhThMabDcH8ccsRMZIGMr/dvaPb68uLRIw7RKH+/mIsPRZ7vVEYFRbYxpGmCsl/RmAOwyplON6dNQkPdI8dbFHMiifV1qSkQ9D55SVbT8nfxXYdNmwrnrL92KCKsNlIl7w7BNm/sIOdW+RgsRgnKKo8uzsP7qhgUbdGdCkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3cEBm3afJnCJsx0D272K6qRrDRH5ybbFALsZcFYqKVM=; b=mxOO5+hc4kelTMjjmcSkOiY59fA+K6T3lGcC0wveHO8OA90x7zj6AIYP8s7ZdPQR/klJMuXfr+3Ah14bsl+PmtYdFKOtfimDKzfKZbJqkmPT0ICMwfuqnUuPU+5hgN0rheLVobOMilncutUFn62jpjjB69iZdQm4OmnkWdOcv4gXpGIukQ6Q+FC+Vynlhwy9QJYu7eAUt1g9bEc9gX2vbEUaUl99xnRBQJPeZfdr/pG2h+87sHAlw3QZvmT0fvevOaGxRON4rbO75+oHqDVZm1EpiPX7n4NTQ7Mwcr2s0lMbmsYn+EWHn1bSaDElckjd3q+btSdDoqkBmCl2Z4p5xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=4js.com; dmarc=pass action=none header.from=4js.com; dkim=pass header.d=4js.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ourvolaris.onmicrosoft.com; s=selector2-ourvolaris-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3cEBm3afJnCJsx0D272K6qRrDRH5ybbFALsZcFYqKVM=; b=ZeptvC3fBlUxmWgNaZORdjjE/xNEBnptP/zL68MOll6XEEMzGb279gQIs9IvjfnG5cEu7hw9HraugBt4UJtqAgLupnfgpK5oNjUoKYvPS4CQg0xfuhvuh5zjKnGTRDYAGT/0UnccO4887VFjzKdLb2b2KrQsW5ZfOAanTFoUQYU= Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:1c9::19) by AM7P191MB0693.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:136::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19; Mon, 12 Sep 2022 12:23:31 +0000 Received: from DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::7404:56cd:1bf8:2406]) by DBAP191MB1289.EURP191.PROD.OUTLOOK.COM ([fe80::7404:56cd:1bf8:2406%5]) with mapi id 15.20.5612.022; Mon, 12 Sep 2022 12:23:31 +0000 From: Sebastien Flaesch To: "pgsql-general@lists.postgresql.org" Subject: Resolving host to IP address Thread-Topic: Resolving host to IP address Thread-Index: AQHYxqBxHE/ckaU9dUmDcNFR8SB4sw== Date: Mon, 12 Sep 2022 12:23:31 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBAP191MB1289:EE_|AM7P191MB0693:EE_ x-ms-office365-filtering-correlation-id: 538efb34-1a50-4a99-e6d2-08da94b99b16 x-volarisppoutbound: true x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TbIPiIcRR2NpZgaRcNDPoOu62LsuSkb3sLfI4Ftqraq/BKUZiPuJM3FAgaEXCBF0Sv9Wb71EV8T1zcmd4xK0W33RgcwtGe1euA2J7erly/kV2fDhDsocsjP8IeWwpu4mYjyAsQ9AT6yxSDXRq/U5fbWlwzb8s0UkD4fSKwpaEG1BOAv5ToWSwlIXkbZ9x7tPyN8DZxVMJ/r2KhrCTNSDOHJFSVmxD3hGuvjUiU+ldiclrgN2YBMaOyFpqFk5BPX0dKomZ059mDUUQiUm6T1M1x5E+105yJ58hYkjmBOtuGwryPRNzEN9mz+7y/nQdGT4Cu8RypOM4JZpaWMbTuEHCv5DbHqRiMV88Yu/qITL6ImsCzmUM6ZTuT99GTdBSdqsagC7wOKIl8ag/J9lZ/e1vWNjr4MTIKTTi8r2uQAnzXVP+uaJ4L+0k3YXFNg47zCJB5/NYxxCbKIBaaZ2BfYxzevxRpgDWwsuzXPJemLuYbZqRw3H4nX9GZ82z7KmnUx2hcBPwn+O5rZ0aILffoALveiJGMhfkGpqspYKIEEBUN7xbg4YZLXHNS+zG76MC9T0svHFRzSsJ8SVTLuBadmspSEd+mYbgoBO6FGTM2kS5lmCzhUEzAJ/Jxm6mnIVtwmx6OjLk5dZVy1L3yVCpGCL2EoOVOze0VvttQyQyRKAd0zHE+nOQVKxd2nS4zUc2Y4tp88Gnjyhz1WnxckyySQti4vDYIRSrSYxaP2U75ZVWJhiWFDerH2Tl+iJP5fzdQSurkhrnj+tipuFOg2STzR6cQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBAP191MB1289.EURP191.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(38070700005)(38100700002)(8676002)(122000001)(66446008)(66946007)(76116006)(66556008)(64756008)(66476007)(91956017)(86362001)(19627405001)(33656002)(2906002)(186003)(83380400001)(7696005)(6506007)(71200400001)(9686003)(26005)(478600001)(316002)(6916009)(41300700001)(55016003)(44832011)(5660300002)(8936002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?mtSqC+z67FuB6qDy1YsZFKGBTGnQeYNwdqHk0cD95F+UDmhv/HvygNqD3i?= =?iso-8859-1?Q?pSsn2oL7C1BO07EEkoUapvW7nPlPkuTUDsg9AlPxtRYuVfNJkbtXFtDQju?= =?iso-8859-1?Q?uq+5duYZYTjb3QYTxNlgV6yX+uGr2k1/LHMzxxeCzTjIpofPQyxeK0Kqp8?= =?iso-8859-1?Q?b2jpDpEq2cQUKgTzwUpmZH9ZsOFXTd8U6Vdd+dq3At4GAFwmhX6cEfYKIA?= =?iso-8859-1?Q?lp1OqmAiNkigadbhm1/mcRp26aOw3M8QyG56A1Vn/J1aBdBUB2mMTKvfnX?= =?iso-8859-1?Q?C5vra67G0KyCrV4nR9FnnpiWL/++5QkDmWtsqyMxJixdkECIBuGj50/hfc?= =?iso-8859-1?Q?xyxfYSHzFNiJ5wJOb0zo/DCLjCp1qu6j9NB0NVzjayVtgKrs8MTdMXchuS?= =?iso-8859-1?Q?pl0ROQfqRG2w5zqN/xQHniFJJNWkahTNiY31Iljvc6ymkIEJ6YEI45duYv?= =?iso-8859-1?Q?/5PxTW0c+4gNTtboVI4H1KW4FrUjyUXsutQb6JSjR6n+KvOQhGdQa62IgQ?= =?iso-8859-1?Q?jW4VVYgr5j9sCukyoD7UjtGpyphzf0l9Mn7jgH1UWBFcfIyjzbnx44t2Wj?= =?iso-8859-1?Q?7AIPGhtwuNRGEW1ZbxtTv2Xe50DRui5bHdS7AyAL28KawKeecgxzkeJ5dv?= =?iso-8859-1?Q?SukdGu7FwFBDzxSTfbIFaiT3A93i//SABV8gPJ4eWTOkOYPpLbXZS4CE16?= =?iso-8859-1?Q?hUBuNsd84ko1NPO68gNv62GBJwDRyKkn3SwPxyBf32avL5BjaY0laPuQ/V?= =?iso-8859-1?Q?ABSg0f5HwkHsE8/08zBSaTjhx119d/9qMYOiKUFyo9sq6JUzGDnBLCCOi0?= =?iso-8859-1?Q?vrXSgj2iqXUKc2hTNCIeL6uafCyqWJCyLme1J7HBe8LM8veFUOj3v4B+QV?= =?iso-8859-1?Q?1El1k9wIaayDo5/m04xvk/ZK6COTZFn7SqFNN67SB6pzjspGvFwM2T8QHz?= =?iso-8859-1?Q?HOlcQJbKtDmT/7zBNXFBmKokouyrDNogBugWlrjODO9KxF24tIPEPAV1Jo?= =?iso-8859-1?Q?d4+vBKHLVQOBPAzfM7nB6HrZnN0S25ETc6fqxXz7wBbbj4UkpLRbIVDj4n?= =?iso-8859-1?Q?C+mnb3ZzwyN/e4mrCvw82km3+E5QI6tvAettZI/EERBG9qYMCdFbUTu2yZ?= =?iso-8859-1?Q?6aGj8Agjw13dgbnN0Py2FtehAsoDXlQTJk5JNw58RXcNZ2HlE7PJIJl8Q4?= =?iso-8859-1?Q?fu3eV1//ZZZbfO6Vzy5DkQjKwCNsjstttP/J+95a0YMpIlaLjeZv0amhjV?= =?iso-8859-1?Q?gSwa2pej81Y/ioGBJ8DqGqKsmmhJqAH0wJbAcTKnxUE3RswTwU+m568U4I?= =?iso-8859-1?Q?O9JT45iS1DzBDFsh+T5BXCmfd5JgcDWLim7xxKanMBSXnz3M2vt4SD0Zs7?= =?iso-8859-1?Q?H7T20KuIBCznJajJUanOp+JO8xSld4Y3I8tp0JqCxwEsiiD7/MxYr0tqwi?= =?iso-8859-1?Q?1OYhjQjcOdkKcU3dIX0bG6xgxf7SCCjE1XEbbP844VAl/QsvvbSv9DGGgR?= =?iso-8859-1?Q?y0vtRNUKhIBWksU9gd1zguh8uFpjUqteqyIN80TvmXIWVk3JgHpR53F89I?= =?iso-8859-1?Q?DTb6csTCYsMp6II02xYLLtZWbiS5dFqm+Qvu/r+zP4gXxTB0xif7m3XhQW?= =?iso-8859-1?Q?mPdk/DP1l885XKkDKthnYaOqYbfmjhaAul?= Content-Type: multipart/alternative; boundary="_000_DBAP191MB1289E076178736EEEB600F28B0449DBAP191MB1289EURP_" MIME-Version: 1.0 X-OriginatorOrg: 4js.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBAP191MB1289.EURP191.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 538efb34-1a50-4a99-e6d2-08da94b99b16 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Sep 2022 12:23:31.8020 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 75c696ec-5bfb-4892-9a0c-9187a9061cd6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 4t8MBKcf867GgFKbHj12TWoldQQjXQcene3oNnLtxx2Ntl5l/yN/AF5tD00ptTcedFQq7SfxHHxZ6k8eipRKqjeaA0DuyPDg+BoOU5O+0nw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7P191MB0693 X-Proofpoint-GUID: NW1aiVx9gRjd3vjizyCYuq0Xkaib706i X-Proofpoint-ORIG-GUID: NW1aiVx9gRjd3vjizyCYuq0Xkaib706i X-ProofpointHeader: Yes X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 priorityscore=1501 spamscore=0 impostorscore=0 mlxscore=0 bulkscore=0 clxscore=1015 mlxlogscore=790 adultscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209120041 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_DBAP191MB1289E076178736EEEB600F28B0449DBAP191MB1289EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi! I am playing with PostgreSQL TLS/SSL connections using OpenSSL, with server= and client certificates. I managed to establish the secure connection, by using DN=3Droot.strasbourg= .4js.com for the self-signed root CA, and DN=3Dtoro.strasbourg.4js.com for = the server certificate, DN=3Dpgsuser for the client certificate. I have created my client certificate by using the root CA. pg_hba.conf: hostssl all pgsuser toro.strasbourg.4js.com md5 client= cert=3Dverify-ca Server and client are on the same Debian 11 machine. It works, if I comment out the /etc/hosts line set by Debian Linux for my h= ost name: # 127.0.1.1 toro.strasbourg.4js.com toro The name "toro" is then resolved to the IP address provided by my DHCP serv= er: root@toro:~# host toro toro.strasbourg.4js.com has address 10.0.40.61 root@toro:~# host toro.strasbourg.4js.com toro.strasbourg.4js.com has address 10.0.40.61 However, if I put the 127.0.1.1 line back in /etc/hosts, re-create all cert= ificates (is this actually needed? I guess no), restart the PostgreSQL serv= er, I get this error: $ psql 'postgresql://toro.strasbourg.4js.com:5437/test1?user=3Dpgsuser&sslm= ode=3Dverify-ca&sslrootcert=3D./root.crt&sslcert=3D./client.crt&sslkey=3D./= client.key' psql: error: connection to server at "toro.strasbourg.4js.com" (127.0.1.1),= port 5437 failed: FATAL: no pg_hba.conf entry for host "127.0.0.1", user = "pgsuser", database "test1", SSL encryption What looks strange to me in this error is that first it mentions 127.0.1.1 = (ok) but then, 127.0.0.1 What am I missing here? Thanks! Seb --_000_DBAP191MB1289E076178736EEEB600F28B0449DBAP191MB1289EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi!

I am playing with PostgreSQL TLS/SSL connections using OpenSSL, with server= and client certificates.

I managed to establish the secure connection, by using DN=3Droot.str= asbourg.4js.com for the self-signed root CA, and DN=3Dtoro.strasbour= g.4js.com for the server certificate, DN=3Dpgsuser for the client certifica= te.

I have created my client certificate by using the root CA.

pg_hba.conf:

hostssl all             pgsuser    =     toro.strasbourg.4js.com  md5 clientcert=3Dverify-ca

Server and client are on the same Debian 11 machine.

It works, if I comment out the /etc/hosts line set by Debian Linux for my h= ost name:

# 127.0.1.1       toro.strasbourg.4js.com toro

The name "toro" is then resolved to the IP address provided by my= DHCP server:

root@toro:~# host toro
toro.strasbourg.4js.com has address 10.0.40.61

root@toro:~# host toro.strasbourg.4js.com
toro.strasbourg.4js.com has address 10.0.40.61

However, if I put the 127.0.1.1 line back in /etc/hosts, re-create all cert= ificates (is this actually needed? I guess no), restart the PostgreSQL serv= er, I get this error:

$ psql 'postgresql://toro.strasbourg.4js.com:5437/test1?user=3Dpgsuser&= sslmode=3Dverify-ca&sslrootcert=3D./root.crt&sslcert=3D./client.crt= &sslkey=3D./client.key'
psql: error: connection to server at "toro.strasbourg.4js.com&quo= t; (127.0.1.1), port 5437 failed: FATAL:  no pg_hba.conf entry = for host "127.0.0.1", user "pgsuser", database &= quot;test1", SSL encryption


What looks strange to me in this error is that first it mentions 127.0.1.1 = (ok) but then, 127.0.0.1

What am I missing here?

Thanks!
Seb
--_000_DBAP191MB1289E076178736EEEB600F28B0449DBAP191MB1289EURP_--