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 1l31jI-0005Tr-Gp for pgsql-general@arkaria.postgresql.org; Fri, 22 Jan 2021 19:04:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l31jH-0005EU-FB for pgsql-general@arkaria.postgresql.org; Fri, 22 Jan 2021 19:04:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l31jH-0005EN-5Q for pgsql-general@lists.postgresql.org; Fri, 22 Jan 2021 19:04:19 +0000 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l31jE-0002Bx-O2 for pgsql-general@lists.postgresql.org; Fri, 22 Jan 2021 19:04:18 +0000 Received: by mail-io1-xd34.google.com with SMTP id n2so13288093iom.7 for ; Fri, 22 Jan 2021 11:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=5L5d4Y2AXm9jh/x3p65/wICw1fKEvp7/t7aHViBaeLw=; b=god6kDiPnGKssQoc/Nihvvmj0/iWhjHwL5120Xzv96voC+McV31+I/IsYbOIeyyXem s4Z5EHf/CJWV6L6ZiuZWFpgbeBrO5Q0lSeegmLrhI5QZefNP26SCcEQqPE31dxD5lHVU lPvR74q8yBbGjymprtXsOWtoWaNlr1wqsgFXrpXbRSW6sbO2vEAHor+WMDPZYxeGaHiq Nqi2wWL2n7ZeUvFnDotpaKvqcW76Cl/Lf2kIpIuK1MHrGuB1FSx6tlRpIe56tiDBywuq +dIjUQKsfsdWDkYUVG92smpx6N+XK+BY6qzDRgr0WyrZKTLuq5AOCrEVsz9fKdGykPaL 8I+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=5L5d4Y2AXm9jh/x3p65/wICw1fKEvp7/t7aHViBaeLw=; b=epgkhzPyhK5ZkV4koOkbG3/BhlRINN62svUpBwHhptJ0KHAj1RC4QXd/X0G/LFfGkW YG4b8Q0JIcha0hnI+uE7lMMmZeSCvYqUMEgJOd952kz+oLlLu5Bkd+J/Lt/7guuQ+Amc bwphnGsq8650m9ecIXEN2ZsMbV96t9Xx6PJju0vkaCy8G+r6cVMBX2eIAInMoYJZrIFT GVa/IB/ZbaDOePJ2ddZWdPrt8EfjSyJVs0ZQsGccgxH6gQEiImeAeIG/dAyf9TJrf4gF QaQ5YIAqU7lQ064nyfAR6dsMXfn1BE86Hwb4UBArY0Ma7ZZWFX9V32N8dX31wbmouAsE EtNw== X-Gm-Message-State: AOAM5333mt3nvkXXMkhDyqIqLTWShNl+U6UCnFljZ44vyu2bblLChyyY QL00GBJuFa+CBVXw1n8ov1vEW0xHObM= X-Google-Smtp-Source: ABdhPJwyEhrEwiG4izxcTWSe3TCajtn3j56tgZwn1AlL4tjEjHn6rHIUEVt0ZR2CFhj6yC6t/o+7PQ== X-Received: by 2002:a92:c147:: with SMTP id b7mr1693395ilh.255.1611342254745; Fri, 22 Jan 2021 11:04:14 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:5928:5288:3618:3f11? ([2601:681:5500:dde0:5928:5288:3618:3f11]) by smtp.gmail.com with ESMTPSA id i8sm6267257ilv.57.2021.01.22.11.04.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Jan 2021 11:04:14 -0800 (PST) To: "pgsql-generallists.postgresql.org" From: Rob Sargent Subject: localhost ssl Message-ID: Date: Fri, 22 Jan 2021 12:04:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I will need to enforce ssl/tls in my production environment so I thought I would try setting things up on localhost to see how that went. Then I noticed that my successful connections from "/usr/lib/postgresql/12/bin/psql -U postgres -h localhost -P pager=off postgres" report: psql (12.5 (Ubuntu 12.5-0ubuntu0.20.04.1)) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help. though my pg_hba.conf does not specify SSL at all # Database administrative login by Unix domain socket local all postgres peer # TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all peer # IPv4 local connections: host all all 127.0.0.1/32 md5 host all all 127.0.1.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 So to the questions: 1. Am I already getting encrypted connections and if so, how? 2. In production I hope to name the role with each connection as I want the search_path set by the connecting role. Will I need a cert per role with CN=?