acme/
lib.rs

1//! Provisioning certificates from ACME (Automatic Certificate Management Environment) providers
2//! such as [Let's Encrypt](https://letsencrypt.org/).
3//!
4//! It follows the [RFC 8555](https://datatracker.ietf.org/doc/html/rfc8555) spec, using ACME v2 to
5//! issue and manage certificates.
6//!
7//! # Usage
8//!
9//! - This crate exposes a library which is referenced as `acme`. This name is used throughout these
10//!   docs, not `acme_rfc855`, which would be awkward to write every time.
11//! - TODO
12//!
13//! ## Examples
14//!
15//! Complete usage examples are provided in the source repository for these challenge types:
16//!
17//! - [`tls-alpn-01` →](https://github.com/x52dev/acme-rfc8555/blob/main/examples/tls-alpn-01.rs)
18//! - [`http-01` →](https://github.com/x52dev/acme-rfc8555/blob/main/examples/http-01.rs)
19//!
20//! # Domain Ownership
21//!
22//! Most website TLS certificates tries to prove ownership/control over the domain they are issued
23//! for. For ACME, this means proving you control either:
24//!
25//! - a server answering TLS or HTTP requests for that domain;
26//! - the DNS server answering name lookups against the domain.
27//!
28//! To use this library, there are points in the flow where you would need to modify either the web
29//! server or DNS server before progressing to get the certificate.
30//!
31//! See [`tls_alpn_challenge`], [`http_challenge`], and [`dns_challenge`].
32//!
33//! ## Multiple Domains
34//!
35//! When creating a new order, it's possible to provide multiple alt-names that will also be part of
36//! the certificate. The ACME API requires you to prove ownership of each such domain. See
37//! [`authorizations`].
38//!
39//! # Rate Limits
40//!
41//! The ACME API provider Let's Encrypt uses [rate limits] to ensure the API is not being abused. It
42//! might be tempting to put the `delay` really low in some of this library's polling calls, but
43//! balance this against the real risk of having access cut off.
44//!
45//! ## Use Staging For Development!
46//!
47//! Especially take care to use the Let's Encrypt staging environment for development where the rate
48//! limits are more relaxed. See [`DirectoryUrl::LetsEncryptStaging`].
49//!
50//! [`http_challenge`]: crate::order::Auth::http_challenge()
51//! [`tls_alpn_challenge`]: crate::order::Auth::tls_alpn_challenge()
52//! [`dns_challenge`]: crate::order::Auth::dns_challenge()
53//! [`authorizations`]: crate::order::NewOrder::authorizations()
54//! [rate limits]: https://letsencrypt.org/docs/rate-limits
55
56#![deny(rust_2018_idioms, nonstandard_style, future_incompatible)]
57
58mod acc;
59mod cert;
60mod dir;
61mod error;
62mod jws;
63mod req;
64mod trans;
65
66pub mod api;
67pub mod order;
68
69#[cfg(test)]
70mod test;
71
72pub use crate::{
73    acc::{Account, RevocationReason},
74    cert::{create_p256_key, Certificate},
75    dir::{Directory, DirectoryUrl},
76};