2 个不稳定版本
0.2.0 | 2021 年 3 月 3 日 |
---|---|
0.1.0 | 2021 年 2 月 11 日 |
在 加密学 中排名 #2297
37KB
665 行(不含注释)
acme-rs
用 Rust 编写的 ACME 客户端(用于 Let's Encrypt 请求 SSL/TLS 证书)。此客户端遵循RFC8555中指定的指南。
内容
特性
acme-rs
目前仅支持 http 挑战。80 端口不得被阻止。- 您可以在执行客户端之前首先生成证书的密钥对。
- 默认情况下,acme-rs 会将请求发送到 URL https://acme-v02.api.letsencrypt.org/directory。但是,您可以使用
--server
标志手动更改 ACME 服务器 URL。只需确保您传入指向 目录 信息的 URL。然后客户端将从端点获取所有路径以进行后续请求。
此crate 还公开了一个库,允许用户在其代码中获取证书。文档可以在 docs.rs 上找到。库公开的主要功能是 generate_cert_for_domain
。
安装
安装过程通过 crates.io
完成。要安装此工具的最新版本,请运行
cargo install acme-rs
您也可以指定安装路径(例如,如果您想将工具全局安装)
cargo install acme-rs --root /usr/local/bin
使用
acme-rs
使用 openssl
Rust 封装 crate 来生成密钥和 CSR。
客户端会将证书和证书链存储在文件 cert.crt
和 chain.crt
中。
请求证书
您可以使用以下命令请求证书
acme-rs [OPTIONS] --domain <domain> --email <email>
选项
通过运行命令 acme-rs --help
,您可以获得所有可用命令的概述。
An acme client (RFC8555) written in the rust programming language
USAGE:
acme-rs [FLAGS] [OPTIONS] --email <email> --domain <domain>
FLAGS:
-h, --help Prints help information
-v, --verbose Enables debug output
-V, --version Prints version information
OPTIONS:
-d, --domain <domain> The domain to register the certificate for
-e, --email <email>
--private-key <private-key> An optional private key file (PEM format) to load the keys
from
--public-key <public-key>
-s, --server <server> The ACME server's URL
依赖关系
~26–44MB
~1M SLoC