Re: Creating Certificates

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Creating Certificates
Date: 2018-10-13 18:38:24
Message-ID: 20181013183824.GB13042@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On Sat, Oct 6, 2018 at 08:17:04AM +0900, Tatsuo Ishii wrote:
> In "18.9.3. Creating Certificates",
>
> ------------------------------------------------------------------
> To create a server certificate whose identity can be validated by
> clients, first create a certificate signing request (CSR) and a
> public/private key file:
>
> openssl req -new -nodes -text -out root.csr \
> -keyout root.key -subj "/CN=root.yourdomain.com"
> chmod og-rwx root.key
>
> Then, sign the request with the key to create a root certificate
> authority (using the default OpenSSL configuration file location on
> Linux):
>
> openssl x509 -req -in root.csr -text -days 3650 \
> -extfile /etc/ssl/openssl.cnf -extensions v3_ca \
> -signkey root.key -out root.crt
> ------------------------------------------------------------------
>
> For me it seesm the two-step procedure can be replaced with following
> one command:
>
> openssl req -new -x509 -nodes -text -days 3650 \
> -config /etc/ssl/openssl.cnf -extensions v3_ca \
> -out root.crt -keyout root.key -subj "/CN=root.yourdomain.com"
>
> Is there any reason why our doc recommend the two-step procedure?

This was changed as part of this commit:

commit 815f84aa166de294b80e80cc456b79128592720e
Author: Bruce Momjian <bruce(at)momjian(dot)us>
Date: Sat Jan 20 21:47:02 2018 -0500

doc: update intermediate certificate instructions

Document how to properly create root and intermediate certificates using
v3_ca extensions and where to place intermediate certificates so they
are properly transferred to the remote side with the leaf certificate to
link to the remote root certificate. This corrects docs that used to
say that intermediate certificates must be stored with the root
certificate.

Also add instructions on how to create root, intermediate, and leaf
certificates.

Discussion: https://postgr.es/m/20180116002238.GC12724@momjian.us

Reviewed-by: Michael Paquier

Backpatch-through: 9.3

The reason I did this in two steps was so I could explain each step
independently, and because the next paragraph, "create a server
certificate signed by the new root certificate authority", also requires
two steps. My goal was that the first command in each example creates
the CSR and public key pair, and the second command signs it. If the
first example uses only one command, and the second example needs to use
two commands, and it appears more complex.

I guess we could show the single-command example as an alternative, but
that seems more complex too.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2018-10-14 01:01:57 Re: v11: RETURN syntax for procedure
Previous Message Bruce Momjian 2018-10-13 17:31:48 Re: Ambiguous usage of 'any' in explanation

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2018-10-13 19:39:39 Re: WIP: Avoid creation of the free space map for small tables
Previous Message Bruce Momjian 2018-10-13 18:10:16 Re: Changes in Brazil DST's period