[关闭]
@zhongdao 2022-01-18T02:24:40.000000Z 字数 1760 阅读 917

cfssl 与 smallstep 等使用说明

未分类


===== CFSSL

安装使用cfssl工程

以下是在命令行上使用 CFSSL 签署证书的示例:

  1. $ cfssl sign -ca-key=test-key.pem -ca=test-cert.pem www.example.com example.csr

或者,可以通过/api/v1/cfssl/sign端点将包含 CSR 和主机名的 POST 请求发送到 CFSSL 服务。要运行该服务,请serve按如下方式调用命令:

  1. $ cfssl serve -address=localhost -port=8888 -ca-key=test-key.pem -ca=test-cert.pem

如果您已经有一个 CFSSL 实例在运行(在本例中是在本地主机上,但它可以在任何地方),您可以使用 gencert 命令的-remote选项自动创建证书。例如,如果 CFSSL 在 localhost 上运行,则运行以下命令将为您提供一个私钥和一个由 CA 签名的证书:

  1. $ cfssl gencert -remote="localhost:8888" www.example.com csr.json

生成文件

  1. cfssl gencert -remote="localhost:8888" geekscsr.json | cfssljson -bare server2

资料

命令行建立CA可参考的主要文档:

实现命令行颁发根与二级CA证书,最终颁发终端WebServer证书:

https://computingforgeeks.com/build-pki-ca-for-certificates-management-with-cloudflare-cfssl/

一个更简单的颁发证书的过程:

https://rob-blackbourn.medium.com/how-to-use-cfssl-to-create-self-signed-certificates-d55f76ba5781

比较详尽的包含证书链验证的完整的文章:(三部曲之1)

https://propellered.com/posts/cfssl_setting_up/

搭建 api 和 ocsp server :

https://medium.com/@vrmvrm/setup-cloudflare-cfssl-with-ocsp-responder-aba44b4134e6

使用 SQLite 数据库后端设置 CFSSL OSCP 和 API 服务器 :(三部曲之2)

https://propellered.com/posts/cfssl_setting_up_ocsp_api/

吊销证书并运行 OCSP 响应程序:(三部曲之3)

https://propellered.com/posts/cfssl_revoking_certs_ocsp_reponder/

sqlite 安装过程

Use goose to start and terminate a SQLite DB

  1. // docker run -it nouchka/sqlite3
  2. apt -y install sqlite3 libsqlite3-dev
  3. go get bitbucket.org/liamstask/goose/cmd/goose
  4. cd ~/go/src/cfssl
  5. goose -path certdb/sqlite up
  6. cat ~/go/src/cfssl/certdb/sqlite/migrations/001_CreateCertificates.sql | sqlite3 certdb.db
  7. vi sqlite_db.json
  8. {"driver":"sqlite3","data_source":"certdb.db"}

ocsp的反应实例展示:

https://github.com/cloudflare/cfssl/issues/965

OCSP的过程解释:

https://akshayranganath.github.io/OCSP-Validation-With-Openssl/

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注