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 1lBiBI-0001nv-Ij for pgsql-general@arkaria.postgresql.org; Mon, 15 Feb 2021 18:01:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lBiBH-000235-H8 for pgsql-general@arkaria.postgresql.org; Mon, 15 Feb 2021 18:01:07 +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 1lBiBH-00022y-7I for pgsql-general@lists.postgresql.org; Mon, 15 Feb 2021 18:01:07 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lBiBD-000879-KH for pgsql-general@lists.postgresql.org; Mon, 15 Feb 2021 18:01:06 +0000 Received: by mail-oo1-xc31.google.com with SMTP id f1so1728184oou.0 for ; Mon, 15 Feb 2021 10:01:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=hmylJ+cowIM1FZT3eLjtwE+OzIIn5xnLKJNtYSk0FBg=; b=XBNDSkN6ZgDx7G45tSSZ74Lb/X3jzW31H7b9/6VNymK3VGKdTD1xcexKuJXdU5cMGl 6wSOIbJgEfTcp/+U+Z3VplY7WRITPHqsoMQT6BEmFGy2Tl+5JDgV00EuQfVac6htunk+ XkJyM+bYHj+V6QT90A3dknTfT/cOJznVVzKICLmPQrGP7WXTQH6kk23iADaghHI4yqvA MlakRpZlL/9QWNT9SL1Z3CkikAwmrYKF+NCi9STp0oyFZ8gNs0Un/Hg05CZ3XxuBKe9T tc9CRb96qV3m3aWckVADnLpioVZa/45PL5zLHIWaM7kK2KIZO+vY2DUOdHmJme2rz24K QHDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hmylJ+cowIM1FZT3eLjtwE+OzIIn5xnLKJNtYSk0FBg=; b=RAoZt+3d6J/YQPVm9P3lu6xsjnzgKlZV2XMqTExL5CI2ro0ak2ZLAg555RIfoFsTRO wrawQJjvv7mzDid1yNqdr+EXStKzSUrhIuqW7kZq9n5XYL4q4Z09XdXHhuNtLnbnYByK irxd4m3HJvjUrvMQ1oQ69Ua2zfSrcP+NhZ4bvHqOIFvDJZ24WvlSmv+b5sQeuXf/kL8J CSa1+mKr1VGMOwYgGekgh/4smSK0/vND56HmwjVZ2zygNd6rdrTUffHScClv6Th4do9M Jgvqh0X3pNOdCph//XyJmCHHXB4/WUesOXC8ozb7hknjPGtaOW+bdTryWrOmuaL3rkYv O0WA== X-Gm-Message-State: AOAM530mboF2unurbda86+FHYTY3duXYaijqYDSU8tLD7KMq4gAs+Obn 3azCtUoljGSf+F1yZfmW/IfzXVjYuyU= X-Google-Smtp-Source: ABdhPJxZVAczx9m1/254HdyZ3f+ZDbOzgYRWunPK5lb7g5lzlCodK0xBpI7XcuV062073vAIJLfo3Q== X-Received: by 2002:a4a:2515:: with SMTP id g21mr11810451ooa.27.1613412062546; Mon, 15 Feb 2021 10:01:02 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:216a:ac73:ce4:9476? ([2601:681:5500:dde0:216a:ac73:ce4:9476]) by smtp.gmail.com with ESMTPSA id v124sm3487316ooa.22.2021.02.15.10.01.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Feb 2021 10:01:02 -0800 (PST) Subject: Re: certs in connection string To: Laurenz Albe , "pgsql-generallists.postgresql.org" References: <89C60392-DFF9-4C1A-BB0D-DD54608F2AA5@gmail.com> <8adec105140aebabf0814880fd88d3ed8fac8c3e.camel@cybertec.at> From: Rob Sargent Message-ID: Date: Mon, 15 Feb 2021 11:01:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <8adec105140aebabf0814880fd88d3ed8fac8c3e.camel@cybertec.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/15/21 8:23 AM, Laurenz Albe wrote: > On Sat, 2021-02-13 at 09:57 -0700, Rob Sargent wrote: >> I’m confused, as usual, about using a cert in a connection string. I wish to connect form a >> “middle ware” piece to PG on be half of various clients. Does each client need a corresponding >> cert/key or is the certification intended to say the sending machine is who it says it is >> (thereby needing only one cert) > > They can share one certificate. > > https://www.postgresql.org/docs/current/auth-cert.html: > > When using this authentication method, the server will require that the client provide a valid, > trusted certificate. No password prompt will be sent to the client. The cn (Common Name) > attribute of the certificate will be compared to the requested database user name, and if they > match the login will be allowed. > > Yours, > Laurenz Albe > Thank you. Since I wish to make the jdbc connection using the role's login (for search_path, I take it I will make role-specific certs, setting the CN accordingly. (I do know which role I need for each connection request and can set the dbname as well).