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 1lF3SJ-00046B-8D for pgsql-jdbc@arkaria.postgresql.org; Wed, 24 Feb 2021 23:20:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lF3SG-00076E-5N for pgsql-jdbc@arkaria.postgresql.org; Wed, 24 Feb 2021 23:20:28 +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 1lF3SF-000767-U4 for pgsql-jdbc@lists.postgresql.org; Wed, 24 Feb 2021 23:20:28 +0000 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lF3SD-00050x-OW for pgsql-jdbc@lists.postgresql.org; Wed, 24 Feb 2021 23:20:27 +0000 Received: by mail-oi1-x22f.google.com with SMTP id a13so4285094oid.0 for ; Wed, 24 Feb 2021 15:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:subject:from:message-id:date:user-agent:mime-version :content-language; bh=gKk3/BMZmLyTnHNz13Rm9OZTliF3lHIrjXNmWAtJ060=; b=vWEm7IwEOuEfiN+JZ3Pd7egdfeBaFeQz4aWnOUoAUEaI53bY8pyw5r4f3SpSDCcDFP QqRnJtQEv39gUfx6k43LwQ7Zb5Qp/6oBV24VLJU/yFDy+gma/LxYVyjLlOOFFx/zVMCi BGQvI5155FbhpcOQXg7K5qcIF2aAPtj6SnoxoKjwe0vUpask65OMymDGO1MNVmX0k3kh J0JCZbPEMCLrzMWGRDUtSDoe5+LZGfL3ciPPbZDfoq2EEIpb9hFrvWofk3qIHyiVCjAx zu38q6ONbt+oHQFTdfLMnPl4wGmNQjxgJuq9LCWsbraBJE1tE9YUvu1dobEuvg4PF0Hf I8iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:from:message-id:date:user-agent :mime-version:content-language; bh=gKk3/BMZmLyTnHNz13Rm9OZTliF3lHIrjXNmWAtJ060=; b=sHoLFCSebrS9k7hkZWemiUWP5Bnk3Eq96GqnNFYfEL1kBTke0eWUBg8Obst8bimpW2 ncTiPsOPhZ9Xzyw0Omy9zLwRx8gterJKzlB5oqqj9HWCbgKWZRhTvydmwddSTb2po77r YPq2bgU0w4wMro1ym0zmUbOdLy1R3/lt4cMXjdj9ex0qp+PG8a2LLGPpUoknHf1Qw37o bTwviV6doqs9tZGN4wN6BywbXJlEyC42/S5zS5cvjsJ1tlI31OtD6IigW8qBFRcFNth+ +/CpJv1Pjjm9PpMwMjI+RLVWUDR48Fk8hlk5yNTI14CEe3YVL1HlJEI+O+L19vbxKRLC qBJg== X-Gm-Message-State: AOAM531xMYLmR7q9CtIrymskUUO46OF9WwAExuQskHaegzAHCuHEv0fH K8mtf6IzSlj/aLqYjkcSI0oK5AukBJU= X-Google-Smtp-Source: ABdhPJz65vnBAuZzP5j4zgaDddzu0nhcecRv9+mcojnBF2RyWmJnbWmdh4nHNNdHwoAGCqW3wAR4vw== X-Received: by 2002:aca:d883:: with SMTP id p125mr7938oig.114.1614208823505; Wed, 24 Feb 2021 15:20:23 -0800 (PST) Received: from ?IPv6:2601:681:5500:dde0:808f:3374:6e8d:3710? ([2601:681:5500:dde0:808f:3374:6e8d:3710]) by smtp.gmail.com with ESMTPSA id u15sm577913oiu.28.2021.02.24.15.20.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Feb 2021 15:20:23 -0800 (PST) To: pgsql-jdbc@lists.postgresql.org Subject: PEM to PKCS12 From: Rob Sargent Message-ID: Date: Wed, 24 Feb 2021 16:20:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------A44C48FEB3C2D963CDF38482" Content-Language: en-CA List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------A44C48FEB3C2D963CDF38482 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Given PEM from AWS/RDS, which appear to me to include only the certificate, here's what I did to get to PKCS12 format keytool -import -alias rds-root -keystore root.jks -file rds.pem keytool -importkeystore -srckeystore root.jks -destkeystore root.p12 -deststoretype pkcs12 Is this expected in general (not RDS specific)? If so I would like to add these instrux to connect.md. Or is this even correct? Handing the created .p12 file to the connection url (sslkey=/full/path/root.p12&sslpassword=x&sslmode=verify-full) does not seem to be taking effect. I get could not find "/home/ec2-user/.postgresql/root.crt" which is NOT the full/real path --------------A44C48FEB3C2D963CDF38482 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Given PEM from AWS/RDS, which appear to me to include only the
certificate, here's what I did to get to PKCS12 format
keytool -import -alias rds-root -keystore root.jks -file rds.pem
keytool -importkeystore -srckeystore root.jks -destkeystore root.p12 -deststoretype pkcs12
Is this expected in general (not RDS specific)? If so I would like to
add these instrux to connect.md.

Or is this even correct? Handing the created .p12 file to the connection url
(sslkey=/full/path/root.p12&sslpassword=x&sslmode=verify-full)
does not seem to be taking effect. I get could not find "/home/ec2-user/.postgresql/root.crt"
which is NOT the full/real path




--------------A44C48FEB3C2D963CDF38482--