Commit Graph

20 Commits

Author SHA1 Message Date
Thomas Lamprecht
1e67b44463 api: ACME revoke: do not abort if CA is just expired
Else, a user would need to renew it first before being able to revoke
it, which does not make much sense..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-19 18:52:48 +02:00
Thomas Lamprecht
25beb9038c api: ACME renew: handle error from revoking old cert gracefully
this normally just means that the old cert is already expired, we do
not care for that - after all: we got a new (renewed) valid cert
successfully.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-08-19 18:49:20 +02:00
Fabian Grünbichler
4aa89cc0e8 fix #2784: always compare ACME domains in lower case
otherwise the ACME endpoint might return the ordered domain in lower
case and we fail to find our plugin config.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-06-17 14:00:43 +02:00
Fabian Grünbichler
63ad21645d fix #2771: relax cert API endpoints permissions
allow users with Sys.Modify to modify custom or ACME certificates. those
users can already hose the system in plenty of ways, no reason to
restrict this in particular to being root@pam only.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-06-17 14:00:43 +02:00
Thomas Lamprecht
e01302b764 api acme: reduce after validation-request delay, print status on err
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-07 21:47:53 +02:00
Thomas Lamprecht
c794bb5dc0 api acme: reduce verification delays
As proxmox-acme has now a default delay for DNS challenge plugins,
which is the important one. Those are just for not overloading the
acme servers with a lot of requests, but once the challenge was
propagate they have it verified pretty quickly, so reduce delay for
checking validation after first requesting it down to 10 seconds

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 18:46:12 +02:00
Thomas Lamprecht
b1e879ecae api acme: use the same plugin config for an order
re-loading it always would mean that we could potentially switch the
config to something completely different, and the mix of the previous
and the old could result in total bogus actions.

Better to use the same one for one full order, even if it may get
"outdated" it was still valid in the past and most important
coherent.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 18:46:12 +02:00
Thomas Lamprecht
48662a1eb0 api acme: code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 18:46:12 +02:00
Thomas Lamprecht
75afd54a01 node config: verify abstract relations on write
for now mostly due to the "nice" property of the acmedomains which
do not use their property key as index but actually the doamain.

Without this one could set up duplicated domain entries just fine,
but once using them -> error.
This is not nice UX, so verify node config before writing an updated
one out, to catch those issues.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
91c85a64a0 acme: catch failed plugin setup
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
b87f55d1b8 acme: always use domain from authorization
instead of relying that the authorization URLs and the ordered
identifiers are sorted the same way for already validated
authorizations.

on the contrary, RFC 8555 even says:

"The authorizations required are dictated by server policy; there may
not be a 1:1 relationship between the order identifiers and the
authorizations required."

authorizations MUST always include a single identifier, no matter which
state they are in.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
7b22e2888b acme: drop unused parameter from challenge validation request
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
a810b15449 acme: move more of challenge handling to ACME client
so that we don't have to duplicate this logic for PMG

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
b232807dac acme: improve get_acme_conf
mixed bag of improvements:
- return hash based on domain
- check for duplicate domains, allow overlap between main and additional
keys otherwise

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Fabian Grünbichler
a3a9f9e0ba acme: fix account parsing
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
c30e112eff Adapt acme node config parser and rename the function.
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
a5c3854706 Add function that selects the desired plugin.
These functions also extract the data required for the plugin.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Wolfgang Link
d9012197b3 Use the plugin architecture.
And remove the call of standalone plugin directly.
Prepare all necessary data for the plugin.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2020-05-03 14:10:17 +02:00
Dominik Csapak
c93bc1a1de ACMEv2 order "ready" status update
since letsencrypt updates their implementation to the ACMEv2 spec [1],
we should correctly parse the order status

1: https://community.letsencrypt.org/t/acmev2-order-ready-status/62866

note that we (for now) try to be compatbile to both versions,
with and without ready state, this can be changed when all letsencrypt
apis have changed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-06-25 10:42:17 +02:00
Fabian Grünbichler
9945a5018e add ACME certificate API endpoints
for creating/ordering a new certificate and renewing respectively
revoking an existing one.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-05-02 11:34:52 +02:00