]> git.proxmox.com Git - pve-docs.git/blame - certificate-managment.adoc
add documentation for certificate managment
[pve-docs.git] / certificate-managment.adoc
CommitLineData
aeecd9ea
SI
1[[sysadmin_certificate_management]]
2Certificate Management
3----------------------
4ifdef::wiki[]
5:pve-toplevel:
6endif::wiki[]
7
8
9Certificates for communication within the cluster
10~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11
12Each {PVE} installation creates its own Certificate Authority (CA) and generates
13certificates for each node. These are used for encrypted communication within
14the cluster.
15
16The CA certificate and key are stored in the `pmxcfs` (see the `pmxcfs(8)`
17manpage).
18
19Certificates for API and web GUI
20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
22The API and web GUI are provided by `pveproxy`.
23
24You have the following options for the certificate used by `pveproxy`:
25
261. By default the node-specific certificate in `/etc/pve/local/pve-ssl.pem` is
27used. This certificate is signed by the cluster CA and therfore not trusted by
28browsers and operating systems by default.
292. use an externally provided certificate (e.g. signed by an external CA).
303. use ACME (Let's Encrypt) to get a trusted certificate with automatic renewal.
31
32For Options 2 and 3 the file `/etc/pve/local/pveproxy-ssl.pem` (and
33`/etc/pve/local/pveproxy-ssl.key`, which needs to be without password) is used.
34
35Certificates are managed with the {PVE} Node management command
36(see the `pvenode(1)` manpage).
37
38WARNING: Do not replace the automatically generated node certificate
39files in `/etc/pve/local/pve-ssl.pem` and `/etc/pve/local/pve-ssl.key` or
40the cluster CA files in `/etc/pve/pve-root-ca.pem` and
41`/etc/pve/priv/pve-root-ca.key`.
42
43Getting trusted certificates via ACME
44^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45{PVE} includes an implementation of the **A**utomatic **C**ertificate
46**M**anagement **E**nvironment **ACME** protocol, allowing {pve} admins to
47interface with Let's Encrypt, with which trusted certificates can be generated
48and setup easily.
49
50This enables you to get a Certificate that is accepted by Browsers for public
51facing nodes.
52
53Currently the two ACME endpoints implemented are Let's Encrypt (LE) and its
54staging environment (see https://letsencrypt.org), both using the standalone
55HTTP challenge.
56
57Because of https://letsencrypt.org/docs/rate-limits/[rate-limits] you should use
58LE `staging` for experiments.
59
60There are a few prerequisites to use Let's Encrypt:
61
621. **Port 80** of the node needs to be reachable from the internet.
632. There **must** be no other listener on port 80.
643. Your (sub)domain needs to resolve to the public IP of the Node.
654. You have to accept the ToS of Let's Encrypt.
66
67At the moment the GUI uses only the default ACME account.
68
69.Example: Sample `pvenode` invocation for using Let's Encrypt certificates
70
71-----------------
72root@proxmox:~# pvenode acme account register default mail@example.invalid
73Directory endpoints:
740) Let's Encrypt V2 (https://acme-v02.api.letsencrypt.org/directory)
751) Let's Encrypt V2 Staging (https://acme-staging-v02.api.letsencrypt.org/directory)
762) Custom
77Enter selection:
781
79
80Attempting to fetch Terms of Service from 'https://acme-staging-v02.api.letsencrypt.org/directory'..
81Terms of Service: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
82Do you agree to the above terms? [y|N]y
83
84Attempting to register account with 'https://acme-staging-v02.api.letsencrypt.org/directory'..
85Generating ACME account key..
86Registering ACME account..
87Registration successful, account URL: 'https://acme-staging-v02.api.letsencrypt.org/acme/acct/xxxxxxx'
88Task OK
89root@proxmox:~# pvenode acme account list
90default
91root@proxmox:~# pvenode config set --acme domains=example.invalid
92root@proxmox:~# pvenode acme cert order
93Loading ACME account details
94Placing ACME order
95Order URL: https://acme-staging-v02.api.letsencrypt.org/acme/order/xxxxxxxxxxxxxx
96
97Getting authorization details from
98'https://acme-staging-v02.api.letsencrypt.org/acme/authz/xxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxx'
99... pending!
100Setting up webserver
101Triggering validation
102Sleeping for 5 seconds
103Status is 'valid'!
104
105All domains validated!
106
107Creating CSR
108Finalizing order
109Checking order status
110valid!
111
112Downloading certificate
113Setting pveproxy certificate and key
114Restarting pveproxy
115Task OK
116-----------------