Welcome to ACME client as client/server documentation!¶
Contents:
Develop on ACMEMS¶
Manager¶
-
class
acmems.manager.
ACMEManager
(config, connect=True)¶ Bases:
object
- ACME manager - high level ACME client; process authorizations via
- http01 automatically.
Variables: - responses (dict) – Responses to deliver; designed as answers for authorization challenges. dict[host][path] = value
- authzrs (dict) – List of current active
acme.messages.AuthorizationResource
- config (acmems.config.Configuration) – Active configuration
-
log
(*args)¶ log something
-
connect
()¶ initialize/setup ourself; load private key, create ACME client and refresh our registration
Raises: - acmems.exceptions.AccountError – could not load account
- acmems.exceptions.NeedToAgreeToTOS – terms of service are not accepted - cannot operate
-
load_private_key
()¶ load our private key / the key to identify ourself against the ACME server. This key MUST NOT be used for certificates.
Raises: acmems.exceptions.AccountError – something is broken with our account (mustly key not found)
-
create_private_key
(force=False, key_size=4096)¶ create new private key to be used for identify ourself against the ACME server
Key is afterwards read via
load_private_key
!Parameters: Raises: acmems.exceptions.AccountError – account dir not found or private key will not be overriden (force is
False
).
-
init_client
()¶ create ACME client
-
acquire_domain_validations
(validator, domains)¶ requests for all given domains domain validations If we have cached a valid challenge return this. Expired challenges will clear automatically; invalided challenges will not.
Parameters: domains (list of str
) – List of domains to validateReturns: Challenges for the requested domains Return type: acme.messages.ChallengeBody
Processes a given AuthorizationResource that was fetch from the authzrs cache or updated by
refresh_domain_authorization
/acme.client.Client.poll
.Renew revoked or expired ones. Refresh pending/processing authorizations
Parameters: authzr (acme.messages.AuthorizationResource) – the authzr in question
Returns: a valid authzr
Return type: Raises: - acmems.exceptions.AuthorizationNotYetProcessed – We have to wait while the ACME server processes the autzr
- acmems.exceptions.AuthorizationNotYetRequested – new authzr created; have to wait until someone requests it
- acmems.exceptions.ChallengesUnknownStatus – unknown status
- acmems.exceptions.NoChallengeMethodsSupported – HTTP01 is not supported
- acmems.exceptions.ChallengeFailed – challenge failed
Refreshes a authorization for status changes
Parameters: domain (str) – domain name for the authorization
Returns: a valid authzr
Return type: Raises: - acmems.exceptions.AuthorizationNotYetProcessed – We have to wait while the ACME server processes the autzr
- acmems.exceptions.AuthorizationNotYetRequested – new authzr created; have to wait until someone requests it
- acmems.exceptions.ChallengesUnknownStatus – unknown status
- acmems.exceptions.NoChallengeMethodsSupported – HTTP01 is not supported
Requests a complete new authorization for the given domain
Parameters: domain (str) – domain name for the authorization
Returns: a valid authzr
Return type: Raises: - acmems.exceptions.AuthorizationNotYetProcessed – We have to wait while the ACME server processes the autzr
- acmems.exceptions.AuthorizationNotYetRequested – new authzr created; have to wait until someone requests it
- acmems.exceptions.ChallengesUnknownStatus – unknown status
- acmems.exceptions.NoChallengeMethodsSupported – HTTP01 is not supported
Server¶
-
class
acmems.server.
ACMEAbstractHandler
(request, client_address, server)¶ Bases:
http.server.BaseHTTPRequestHandler
-
send_data
(data, content_type='text/plain', response_code=200)¶ Helper method to send data as HTTP response. The data are transfered as text/plain.
Parameters: - data (str) – The text to send as
Python String
. - response_code (int) – HTTP response code
- data (str) – The text to send as
-
-
class
acmems.server.
ACMEHTTPHandler
(validator, *args, **kwargs)¶ Bases:
acmems.server.ACMEAbstractHandler
-
do_GET
()¶ Handles POST request (upload files).
-
-
class
acmems.server.
ACMEMgmtHandler
(request, client_address, server)¶ Bases:
acmems.server.ACMEAbstractHandler
-
do_POST
()¶ Handles POST request (upload files).
-
Authentication & Processing¶
-
class
acmems.auth.
SubjectAltName
(componentType=None, tagSet=None, subtypeSpec=None, sizeSpec=None)¶ Bases:
ndg.httpsclient.subj_alt_name.SubjectAltName
ASN.1 implementation for subjectAltNames support
-
class
acmems.auth.
Block
(name, options, config)¶ Bases:
object
One authentication block - combination of authentications and list of allowed domains
-
class
acmems.auth.
Processor
(auth, client_address, headers, rfile)¶ Bases:
object
Helper object to process a request, check authentication, reads and parse CSR
-
acceptable
()¶ process the given request parameter for a CSR signing request and decide whether this request is allowed or not.
Parameters: Return bool: whether request should be accepted
-
Configuration¶
Exceptions¶
-
exception
acmems.exceptions.
AcmeException
¶ Bases:
Exception
Base exception call to be able to catch all ACMEMS specific errors
-
exception
acmems.exceptions.
NoChallengeMethodsSupported
¶ Bases:
acmems.exceptions.AcmeException
The domain can not be validated HTTP01
-
exception
acmems.exceptions.
ChallengeFailed
(domain, message, challenge_uri)¶ Bases:
acmems.exceptions.AcmeException
The challenge to validate the requested domain failed.
Variables:
-
exception
acmems.exceptions.
ChallengesUnknownStatus
¶ Bases:
acmems.exceptions.AcmeException
We do not known the status of the challenge. No clue what to do
-
exception
acmems.exceptions.
AuthorizationNotYetProcessed
(wait_until)¶ Bases:
acmems.exceptions.AcmeException
The authorization is be processed; until the next refresh it should at least be wait until
wait_until
Variables: wait_until (datetime.datetime) – first allowed retry time
-
exception
acmems.exceptions.
AuthorizationNotYetRequested
(event)¶ Bases:
acmems.exceptions.AcmeException
The newly created authorization challenge, was installed, but has not yet been requested by any client and is therefore currently pending or invalid.
Variables: event (threading.Event) – event that will be signaled if someone requests the challenge.
-
exception
acmems.exceptions.
RateLimited
¶ Bases:
acmems.exceptions.AcmeException
To many requests
-
exception
acmems.exceptions.
AccountError
¶ Bases:
acmems.exceptions.AcmeException
Generic account error - e.g. - could not read private key - could not refresh the registration
-
exception
acmems.exceptions.
NeedToAgreeToTOS
(url)¶ Bases:
acmems.exceptions.AccountError
We are registered at the ACME server. But to use it, we need to accept the “Terms of Service”
-
exception
acmems.exceptions.
InvalidDomainName
(domain, detail)¶ Bases:
acmems.exceptions.AcmeException
The domain name is not excepted by the ACME server.
Variables:
-
exception
acmems.exceptions.
PayloadToLarge
(size, allowed)¶ Bases:
acmems.exceptions.AcmeException
The payload (CSR) it to large
Variables:
-
exception
acmems.exceptions.
PayloadInvalid
¶ Bases:
acmems.exceptions.AcmeException
The payload is not a valid CSR
ChangeLog¶
This page lists all versions with its changes. ACMEMS follows Semantic Versioning.
Version 0¶
v0.3.1¶
Multiple bug fixes:
- Fix auth-block specific storage and verification settings
- IOError when replace certification in file storage
- Fix typos in dns01-dnsUpdate verification
v0.3.0¶
(Experimental) support for DNS challenges
v0.2.0¶
Reaching base architecture for 1.0 release. This includes:
- Restucture code and! config to support multiple verification mechanism
- WIP: experiment / prepare for dns01 challenge support (via dns updates)
- add storage support to not reissue CSRs the same pem, supporting reissue from multiple machines via a once shared key and CSR
- support newer python-acme releases
v0.1.1¶
- Fix syntax error in setup.py, preventing to upload to PyPI
v0.1.0¶
Implement basic feature set:
- submit CSR
- validate domain via HTTP
- sign certificate
- authenticate clients based on IP and HMAC