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 1lHECh-0001Sn-JT for pgsql-general@arkaria.postgresql.org; Tue, 02 Mar 2021 23:13:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHEC9-0005NU-B9 for pgsql-general@arkaria.postgresql.org; Tue, 02 Mar 2021 23:12:49 +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 1lHEC9-0005NM-0t for pgsql-general@lists.postgresql.org; Tue, 02 Mar 2021 23:12:49 +0000 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lHEC6-0002QD-QD for pgsql-general@lists.postgresql.org; Tue, 02 Mar 2021 23:12:47 +0000 Received: by mail-il1-x130.google.com with SMTP id g9so19642819ilc.3 for ; Tue, 02 Mar 2021 15:12:46 -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=v1o6YBnUBNJux/g1SPKAQDB6GfbKeaFfNhUI0FeZS7c=; b=dXejq3gMW2tTx4ktGUCbT5d+jkwIQC/pmC5XYIcbzvicaAHmGztgwjY3SEutx0gXMO TjWnYnZb8kpRwnOSKDKZVFro/SNIPaFAz0LQ28viCSGsZEOE98xoKrQFTtB49Jeo8voW 7QI9i8NTH/Bd4eYD2L0Uzuna9iTkhj09cAr1KRdU8zDp8LACFNuyoHj6A+hnqFNy1dBb yFm23hjVnI9BxrxmEXpsOvY1932QFzPpuzV6SzAhA27DilMLZ0qwg6CEp17K13kY23hr q4dvcT1Z5JYBJ6FtetaNperdtKN+HvYn8G8GmPSzxb4bIN3qOasKSWg2/VqdQf0rIRef Rbqg== 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=v1o6YBnUBNJux/g1SPKAQDB6GfbKeaFfNhUI0FeZS7c=; b=fsMdIPdrxTzkt7/JBo2Xb8XFBbT2Jv9I6pdrweffUT+EMNpVhijYoPEN9Fus1yY24m 6YeCsSfES1GEE4aYUZwznj2whJPh8vVf/cNR/bO5aNBPYVr2OXaHKKd+dLtsA6Yj7oPJ RKMytMXxps2V9dq+/icjA9zjHi/sNUG8kBHsGaWZBljiwNHr4IvngRWHY/14HG9ecCSo MCFxUDW4X3cLEatZpe3eXB2mkRx3N2xe/pi/wdWp0d23uxR0hc/3mNxPqh+OA+kKwYez gJeBddR/sCE6ks1qN0iKOvL2iEAFRwVtYuqAzgKpj/5nvbVmxGAfRATyNN86PYH9nLwf uNgw== X-Gm-Message-State: AOAM5322IoNTMMurN6M0WNz1zoQW015aJdABZth8j5IJm1nOpyVcXj+y TXech0LIhpaVaBWBCZAk6mcPzJvrnzQ= X-Google-Smtp-Source: ABdhPJy1qFlInMi7tL4NstTGXVJGxxz4xhAe0fDTB3PnW2vCYV0VxEIX5ulV8iv7Q+eYgyOUa9h+Hg== X-Received: by 2002:a92:ce89:: with SMTP id r9mr18406200ilo.191.1614726765826; Tue, 02 Mar 2021 15:12:45 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:e890:9548:a5ad:9d5b? ([2601:681:5500:dde0:e890:9548:a5ad:9d5b]) by smtp.gmail.com with ESMTPSA id o3sm11983064iow.53.2021.03.02.15.12.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Mar 2021 15:12:45 -0800 (PST) To: "pgsql-generallists.postgresql.org" From: Rob Sargent Subject: self-made certs not quite right Message-ID: <4d4837c5-22db-27b8-2592-7fc7c482f02e@gmail.com> Date: Tue, 2 Mar 2021 16:12:44 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 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'm trying to follow instrux in V12:18.9.5 Creating Certificates. [1] I'm stuck in my basement so all references to "/CN=FQN" have been set to $(hostname), just the hostname, because $(domainname) returns "(none)" which I presume is akin to null. With my newly minted certs and keys using psql (to either $(hostname) or localhost) I get the "SSL connection (protocol: TLSv1.3...) message, so long as I have an empty ~/.postgresql directory. If I copy the generated root.crt to ~/.postgresql (chown me.me; chmod 400) I get a plain connection (no ssl). With root.crt in ~/.postgresql, testing the jdbc connection from a tomcat server generates this failure (again either localhost or $(hostname)) Blow out on db connection to jdbc:postgresql://localhost:5432/postgres; SSL error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target org.postgresql.util.PSQLException: SSL error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Is this a pkcs v. pem cat fight? Or is there enough here to tell which step went south, or just start over? [1] https://www.postgresql.org/docs/12/ssl-tcp.html