# Gufo ACME
*Gufo ACME is a Python asyncio client for the ACME protocol.*
[](https://pypi.python.org/pypi/gufo_acme/)


[](https://opensource.org/licenses/BSD-3-Clause)


[](https://github.com/charliermarsh/ruff)
---
**Documentation**: [https://docs.gufolabs.com/gufo_acme/](https://docs.gufolabs.com/gufo_acme/)
**Source Code**: [https://github.com/gufolabs/gufo_acme/](https://github.com/gufolabs/gufo_acme/)
---
The Automatic Certificate Management Environment (ACME) protocol defines a method
for automated certificate signing, now widely used by services
such as Let's Encrypt. Gufo ACME is a Python asyncio ACME client library that
simplifies the protocol complexity with a straightforward and robust API.
Gufo ACME contains various clients which can be applied to your tasks:
* AcmeClient - base client to implement any fulfillment functionality
by creating subclasses.
* DavAcmeClient - http-01 fulfillment using WebDAV methods.
* PowerDnsAcmeClient - dns-01 PowerDNS fulfillment.
* WebAcmeClient - http-01 static file fulfillment.
## Supported Certificate Authorities
* [Letsencrypt](https://letsencrypt.org/)
* [ZeroSSL](https://zerossl.com/)
* Google Public CA
* Any [RFC-8555](https://tools.ietf.org/html/rfc8555) compatible CA.
## Examples
### Account Creation
Create an account and store state to the file.
``` python
client_key = AcmeClient.get_key()
async with AcmeClient(DIRECTORY, key=client_key) as client:
await client.new_account(email)
state = client.get_state()
with open(client_state_path, "wb") as fp:
fp.write(state)
```
### Private Key Generation
To generate a private key in PEM format.
``` python
private_key = AcmeClient.get_domain_private_key()
```
### Generate CSR
To generate a certificate signing request.
``` python
csr = AcmeClient.get_domain_csr(domain, private_key)
```
### Sign Certificate
Sign the certificate using `http-01` challenge:
``` python
CHALLENGE_DIR = "/www/acme/"
class SignAcmeClient(AcmeClient):
async def fulfill_http_01(
self, domain: str, challenge: AcmeChallenge
) -> bool:
v = self.get_key_authorization(challenge)
with open(os.path.join(CHALLENGE_DIR, challenge.token), "wb") as fp:
fp.write(v)
return True
async def clear_http_01(
self: AcmeClient, domain: str, challenge: AcmeChallenge
) -> None:
os.unlink(os.path.join(CHALLENGE_DIR, challenge.token))
...
async with SignAcmeClient.from_state(state) as client:
cert = await client.sign(domain, csr)
```
## Features
* Pure-Python implementation.
* Asynchronous.
* Fully typed.
* Clean API.
* Built with security in mind.
* Robust well-tested code.
* Batteries included.
* 99%+ test coverage.
## On Gufo Stack
This product is a part of [Gufo Stack][Gufo Stack] - the collaborative effort
led by [Gufo Labs][Gufo Labs]. Our goal is to create a robust and flexible
set of tools to create network management software and automate
routine administration tasks.
To do this, we extract the key technologies that have proven themselves
in the [NOC][NOC] and bring them as separate packages. Then we work on API,
performance tuning, documentation, and testing. The [NOC][NOC] uses the final result
as the external dependencies.
[Gufo Stack][Gufo Stack] makes the [NOC][NOC] better, and this is our primary task. But other products
can benefit from [Gufo Stack][Gufo Stack] too. So we believe that our effort will make
the other network management products better.
[Gufo Labs]: https://gufolabs.com/
[Gufo Stack]: https://docs.gufolabs.com/
[NOC]: https://getnoc.com/
Raw data
{
"_id": null,
"home_page": null,
"name": "gufo-acme",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "ACME, Automatic Certificate Management Environment, RFC8555",
"author": "Gufo Labs",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/06/73/e4ca0a60255ec7df5d59a71bec089f65e6d1d0bc0f7b4500da5e5b7eac3c/gufo_acme-0.5.1.tar.gz",
"platform": null,
"description": "# Gufo ACME\n\n*Gufo ACME is a Python asyncio client for the ACME protocol.*\n\n[](https://pypi.python.org/pypi/gufo_acme/)\n\n\n[](https://opensource.org/licenses/BSD-3-Clause)\n\n\n[](https://github.com/charliermarsh/ruff)\n---\n\n**Documentation**: [https://docs.gufolabs.com/gufo_acme/](https://docs.gufolabs.com/gufo_acme/)\n\n**Source Code**: [https://github.com/gufolabs/gufo_acme/](https://github.com/gufolabs/gufo_acme/)\n\n---\n\nThe Automatic Certificate Management Environment (ACME) protocol defines a method\nfor automated certificate signing, now widely used by services\nsuch as Let's Encrypt. Gufo ACME is a Python asyncio ACME client library that\nsimplifies the protocol complexity with a straightforward and robust API.\n\nGufo ACME contains various clients which can be applied to your tasks:\n\n* AcmeClient - base client to implement any fulfillment functionality\n by creating subclasses.\n* DavAcmeClient - http-01 fulfillment using WebDAV methods.\n* PowerDnsAcmeClient - dns-01 PowerDNS fulfillment.\n* WebAcmeClient - http-01 static file fulfillment.\n\n## Supported Certificate Authorities\n\n* [Letsencrypt](https://letsencrypt.org/)\n* [ZeroSSL](https://zerossl.com/)\n* Google Public CA\n* Any [RFC-8555](https://tools.ietf.org/html/rfc8555) compatible CA.\n\n## Examples\n\n### Account Creation\n\nCreate an account and store state to the file.\n``` python\nclient_key = AcmeClient.get_key()\nasync with AcmeClient(DIRECTORY, key=client_key) as client:\n await client.new_account(email)\n state = client.get_state()\nwith open(client_state_path, \"wb\") as fp:\n fp.write(state)\n```\n\n### Private Key Generation\n\nTo generate a private key in PEM format.\n``` python\nprivate_key = AcmeClient.get_domain_private_key()\n```\n\n### Generate CSR\n\nTo generate a certificate signing request.\n``` python\ncsr = AcmeClient.get_domain_csr(domain, private_key)\n```\n\n### Sign Certificate\n\nSign the certificate using `http-01` challenge:\n\n``` python\nCHALLENGE_DIR = \"/www/acme/\"\n\n\nclass SignAcmeClient(AcmeClient):\n async def fulfill_http_01(\n self, domain: str, challenge: AcmeChallenge\n ) -> bool:\n v = self.get_key_authorization(challenge)\n with open(os.path.join(CHALLENGE_DIR, challenge.token), \"wb\") as fp:\n fp.write(v)\n return True\n\n async def clear_http_01(\n self: AcmeClient, domain: str, challenge: AcmeChallenge\n ) -> None:\n os.unlink(os.path.join(CHALLENGE_DIR, challenge.token))\n\n ...\nasync with SignAcmeClient.from_state(state) as client:\n cert = await client.sign(domain, csr)\n```\n\n## Features\n\n* Pure-Python implementation.\n* Asynchronous.\n* Fully typed.\n* Clean API.\n* Built with security in mind.\n* Robust well-tested code.\n* Batteries included.\n* 99%+ test coverage.\n\n## On Gufo Stack\n\nThis product is a part of [Gufo Stack][Gufo Stack] - the collaborative effort \nled by [Gufo Labs][Gufo Labs]. Our goal is to create a robust and flexible \nset of tools to create network management software and automate \nroutine administration tasks.\n\nTo do this, we extract the key technologies that have proven themselves \nin the [NOC][NOC] and bring them as separate packages. Then we work on API,\nperformance tuning, documentation, and testing. The [NOC][NOC] uses the final result\nas the external dependencies.\n\n[Gufo Stack][Gufo Stack] makes the [NOC][NOC] better, and this is our primary task. But other products\ncan benefit from [Gufo Stack][Gufo Stack] too. So we believe that our effort will make \nthe other network management products better.\n\n[Gufo Labs]: https://gufolabs.com/\n[Gufo Stack]: https://docs.gufolabs.com/\n[NOC]: https://getnoc.com/\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Python Automatic Certificate Management Environment (ACME) client",
"version": "0.5.1",
"project_urls": {
"Bug Tracker": "https://github.com/gufolabs/gufo_acme/issues",
"Changelog": "https://github.com/gufolabs/gufo_acme/blob/master/CHANGELOG.md",
"Documentation": "https://docs.gufolabs.com/gufp_acme/",
"Homepage": "https://github.com/gufolabs/gufo_acme/",
"Source Code": "https://github.com/gufolabs/gufo_acme/"
},
"split_keywords": [
"acme",
" automatic certificate management environment",
" rfc8555"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2983b590af5edb5a775f7a4f5850055da52ed4acc38eb901969b365fd682a6bf",
"md5": "372aeee2078ac7da0a66d2f7c58d7f6c",
"sha256": "fc840024bc1abd4f4ed8e9f1280aa0ed6cc151f4e0b7c1cb99aeb0e293032bec"
},
"downloads": -1,
"filename": "gufo_acme-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "372aeee2078ac7da0a66d2f7c58d7f6c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20618,
"upload_time": "2025-09-08T14:30:26",
"upload_time_iso_8601": "2025-09-08T14:30:26.967497Z",
"url": "https://files.pythonhosted.org/packages/29/83/b590af5edb5a775f7a4f5850055da52ed4acc38eb901969b365fd682a6bf/gufo_acme-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0673e4ca0a60255ec7df5d59a71bec089f65e6d1d0bc0f7b4500da5e5b7eac3c",
"md5": "211967ca455fbabe3332400e57c74f00",
"sha256": "c40cb768ee20e76f832b1fec00fb14a0140f2d63b99ddce8b3b7a1d5b0f0d31b"
},
"downloads": -1,
"filename": "gufo_acme-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "211967ca455fbabe3332400e57c74f00",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 23170,
"upload_time": "2025-09-08T14:30:28",
"upload_time_iso_8601": "2025-09-08T14:30:28.267642Z",
"url": "https://files.pythonhosted.org/packages/06/73/e4ca0a60255ec7df5d59a71bec089f65e6d1d0bc0f7b4500da5e5b7eac3c/gufo_acme-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 14:30:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gufolabs",
"github_project": "gufo_acme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gufo-acme"
}