Commit Graph

99 Commits

Author SHA1 Message Date
Rudolf Mayerhofer c3736c0838 Allow multiple sets of the same domain to defined in a single config file (necessary for multiple certs using different key_algorithm) in a list style notation (lists of maps) 2023-07-12 16:10:21 +02:00
Rudolf Mayerhofer 1a98f86aad Fix idna conversion for force-renew (probably broken since the IDNA cleanup) 2023-07-12 16:10:21 +02:00
Rudolf Mayerhofer ef81ea62d1 Unify key_algorithm handling for elipic curves (change naming to ECC but stay backwards compatible) 2023-07-12 16:10:21 +02:00
Rudolf Mayerhofer d1caaf80ef Fix LOG_REPLACEMENTS determination when multiple domain sets exist and we are on a newer version of python 2023-07-12 16:10:21 +02:00
Rudolf Mayerhofer ba644d44f1 Update config id if we have a key algorithm set to allow for multiple certs with different algorithms for the same set of domains
This is a breaking change!
Changes the id for configurations with a key algorithm set, which by default results in changes to serveral dependent configuration values as well,
such as cert_file/key_file/csr_file. This will require existing ECC setups to append the ecc suffix to files in the acertmgr configuration directory
2023-07-12 16:10:21 +02:00
Jan c15b6ec441 Instantiate HashAlgorithm in OCSPRequestBuilder
Installations of more recent cryptography require parameter hash
algorithm to be an instance of hashes.HashAlgorithm, not the bare object
itself.

Fixes #63
2023-07-10 19:27:44 +02:00
Kishi85 6f0ccfdc91 logging: Add real counterparts of IDNA-mapped domains in brackets 2021-09-20 09:26:47 +02:00
Kishi85 460b0119ac configuration: Simplify too complex IDNA conversion 2021-09-13 09:00:59 +02:00
David Klaftenegger e2f7b09b18 certs already contain idna domain names
The idna_convert call here does nothing: when reading a certificate, it
already contains idna domain names. Converting them to idna is
equivalent to the identity function, and can thus be removed.
2021-05-30 16:21:54 +02:00
Kishi85 2e1f5cd894 acertmgr/v2: Handle CA certificate chains properly 2021-05-21 22:50:44 +02:00
Kishi85 9953cb4527 standalone: Fix multiple challange handlers on same port
If you define challenge handlers on a per-domain basis multiple will be
created. This would cause the standalone handler to potientially try
to bind the same port (when configured) multiple times, which would only
work on the first try. Subsequent tries would fail with "Address already
in use". To fix this only bind the server between start and stop of the
challenge and cleanup afterwards.
2021-03-23 18:43:07 +01:00
Kishi85 0648cb7b38 tools: Fix IDNA handler (again) 2020-03-04 14:50:05 +01:00
Kishi85 b37d0cad94 acertmgr: Add a OCSP validation to certificate verification 2020-03-04 14:50:05 +01:00
Kishi85 c33a39a433 tools: make pem file writable by owner before tryting to write
A PEM file might not be writable by the owner when it should be written
(e.g. on Windows), so we have to ensure the file has write permissions
before doing so
2020-03-04 14:40:49 +01:00
Kishi85 97e9be80cf acertmgr: Fix module/function issues on windows 2019-10-28 10:50:09 +01:00
Kishi85 f5f038d47b configuration: global config is now relative to config_dir 2019-10-26 19:11:33 +02:00
Kishi85 ba4dda154b acertmgr: Remove legacy configuration directives (#30) 2019-09-06 16:07:16 +02:00
Kishi85 9b10f10efd dns.*: Use a static query timeout for any DNS queries using dnspython 2019-07-02 12:55:09 +02:00
Kishi85 1a4272f11a authority.v2: invalidate nonces after 2 minutes and re-request
Boulder seems to invalidate older nonces after some time. Therefore we
allow nonces from the cache to be used for up to 2 minutes and after
those they will be considered invalid (and re-requested with an extra
request to the nonce endpoint when necessary)
2019-06-21 11:39:10 +02:00
Kishi85 0b8e49d6ee tools: Display warning about IDNA only if unicode names are in use 2019-06-11 10:05:37 +02:00
Kishi85 af0bb45d73 authority.v2: Properly clear the nonce cache on using it's content 2019-06-11 09:52:55 +02:00
Kishi85 7475d5e73f authority.v2: Check challenge return code on validation as well 2019-06-11 09:52:55 +02:00
Kishi85 abc0c4a9c2 authority: use correct account_key_length 2019-05-13 21:47:31 +02:00
Kishi85 258855c5b4 legacy: fix ToS agreement value 2019-05-13 20:48:44 +02:00
Kishi85 7a019d1ac9 idna: unify usage as tools function 2019-05-06 21:24:24 +02:00
Kishi85 6a07ab1188 tools/configuration: Add support for EC/Ed25519/Ed448 generation 2019-04-19 15:29:44 +02:00
Kishi85 4f0fe2c74a tools: Add support for Ed25519 and Ed448 account keys
Add support for Ed25519 and Ed448 account keys in addition
to already supported algorithms
2019-04-16 19:12:25 +02:00
Kishi85 88d4a52ab9 tools: use cryptography conversion instead of custom function
Use cryptography's int_to_bytes consistently instead of our own number
to byte conversion function
2019-04-16 19:12:15 +02:00
Kishi85 4df74d67d5 tools: add support for EC account keys
Allows usage of pre-generated EC account keys (P-256, P-384, P-521)
in addition to already supported RSA keys.
2019-04-16 19:12:05 +02:00
Kishi85 1f5ef9322b tools: remove six dependency
Always decode string if the functions is available, assume normal string
otherwise
2019-04-07 15:31:07 +02:00
Kishi85 b5bac4870a authority.v1: add deprecation warning
ACMEv1 will be deprecated by letsencrypt.org in 2021* therefore add a
deprecation warning on object creation

* https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430
2019-04-07 15:31:07 +02:00
Kishi85 89be66dc87 acertmgr: implement deployment error handling
Remove the long-standing todo from cert_put and implement useful
error handling and defaults for certificate deployment. Also do
a separate try/expect for each deployed file on every single
certificate.
2019-04-07 15:31:07 +02:00
Kishi85 7c9e7f7d0c authority.v2: use POST-as-GET to remove unauthenticated GET requests
As unauthenticated GET requests are soon to be deprecated,
remove all unacceptable usages and replace with POST-as-GET.
See also https://tools.ietf.org/html/rfc8555#section-6.3
2019-04-07 15:31:07 +02:00
Kishi85 4510aaf393 acertmgr: properly format action output 2019-04-07 15:31:07 +02:00
Kishi85 79b625619a acertmgr: try using a fallback configuration for revoke
If no configuration matching the domains in the given certificate exist
use the globalconfig/default settings for an authority to revoke the
certificate (which might still fail if things do not match up, but the
authority will decide on that)

Configuration parsing for the authority settings is therefore split into
a seperate function which will be called for the 'fallback_authority'
element in runtimeconfig.
2019-04-07 15:31:07 +02:00
Kishi85 762037c42d standalone: cleanup start/stop challenge
stop_challenge should only stop the server if the thread is still alive
2019-04-07 15:31:07 +02:00
Kishi85 e12abbc3cb authority.v1/2: call stop_challenge even if start_challenge fails
start_challenge may raise an exception at any point. to not just destroy
the challenge but also try to stop it in order to clean up anything done
by start_challenge already properly
2019-04-07 15:31:07 +02:00
Kishi85 989d3b585a authority.v1/2: do not re-authorize already valid domains
Skipping re-authorization when not necessary speeds up cert renewal.
2019-04-07 15:31:07 +02:00
Kishi85 fd8c4ec443 authority.v2: cleanup error- and encoding-handling 2019-04-07 15:31:07 +02:00
Kishi85 df6e3a743e authority.v1: Add missing resource to revoke_crt
Add missing resource: revoke-cert to the request payload
2019-04-07 15:31:07 +02:00
Kishi85 79791c53bc tools: update the get_cert_domain function
Add all domains for SAN certificates and convert IDNA values to the
correct representation
2019-04-07 15:31:07 +02:00
Kishi85 b63a0bc424 tools: add log function, update log messages mentioning certificates
This simple implementation writes log messages to stdout/err and flushes
the buffers immediately after the message has been written.

Also update log messages with the certificate CN to a better readable format
Introduce functions for get_cert_cn and get_cert_valid_until to
encapsulate all cryptographic functions consistently in tools.
2019-04-07 15:31:06 +02:00
Kishi85 2046215e37 tools: encapsulate key parameter determination in tools function
This is will isolate more cryptographic functions in the tools module
and allow for easier replacement of any cryptographic function should
the need ever arise
2019-04-07 15:31:02 +02:00
Kishi85 47e3312aad dns: Add additional TXT record verifications to reduce wait time
This may also be used to guarantee a correct TXT record lookup by setting
dns_verify_all_ns=true, a dns_verify_failtime < dns_verify_waittime and
a high enough value of dns_verify_failtime (like 300 seconds)
2019-04-04 13:39:34 +02:00
Kishi85 1aae651d98 modes: unify and optimize challenge handler workflow
- Remove wait times returned by create_challenge
- Remove wait loops from authorities
- Add the wait for valid DNS TXT records in the abstract
  DNSChallengeHandler start_challenge function.
- Move challenge verification to start_challenge in general
2019-04-04 13:39:34 +02:00
Kishi85 54cb334600 acertmgr: add support for the ocsp must-staple extension
Introduces a new config directive and requires at least cryptography 2.1
2019-04-04 13:39:05 +02:00
Kishi85 0a5356a302 configuration: fix broken idna handling 2019-03-31 23:17:02 +02:00
Kishi85 fe7a064604 acertmgr: log exceptions during processing, raise afterward
If anything goes wrong during cert_get/cert_put/running
actions/cert_revoke superseded do not fail completely and continue with
the remaining domains to process. Print all exceptions and after
processing raise a RuntimeError
2019-03-28 21:15:46 +01:00
Kishi85 7e4c350a4f configuration: remove redundant 'domains' parameter, just use domainlist 2019-03-28 14:52:18 +01:00
Kishi85 fa3fc196f3 configuration: unify how ca_file and ca_static are determined
ensure legacy compatibility (also include defaults case) and update README.md
2019-03-28 13:41:27 +01:00