Step ca sign doesn't allow CSR having empty subject with valid sans using acme provisioner

オープン
#1,283 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@hslatman がすでに取り組んでいます。

2024年9月24日 から。

評価

この issue はまだ評価されていません。

説明

Step ca sign command doesn't allow CSR with empty subject with valid sans using acme provisioner.

step ca sign acmet1.localstepca.com.csr acmet1.localstepca.com.crt --acme https://localstepca.com/acme/acme/directory
error creating new ACME order: The request message was malformed

step ca sign acmet1.localstepca.com.csr acmet1.localstepca.com.crt --provisioner acme
✔ What DNS names or IP addresses would you like to use? (e.g. internal.smallstep.com): acmet1.localstepca.com
✔ Provisioner: acme (ACME)
error creating new ACME order: The request message was malformed

DNS names validation failed at Step ca acme server:

WARN[58728] duration="746.54µs" duration-ns=746540 error="invalid DNS name: " fields.time="2024-09-23T11:43:40+05:30" method=POST name=ca nonce=TjBXeFBONFVheUs0TnlHN1I5WHhvbkc3N05PbWRleDE path=/acme/acme/new-order protocol=HTTP/1.1 referer= remote-address=127.0.0.1 request-id=42498344-ef1a-41e9-901c-2f47b389ee5b response="{"type":"urn:ietf:params:acme:error:malformed","detail":"The request message was malformed"}" size=93 status=400 user-agent="Smallstep CLI/0.27.2 (darwin/amd64)" user-id=

This is happening due to cli is adding empty subject to dns identifiers in new-order acme request here:
https://github.com/smallstep/cli/blob/cd6758c91df547d0039768c9413b94e96e55ff24/utils/cautils/acmeutils.go#L376C11-L382C4

Sample CSR to reproduce:
acmet1.localstepca.com.csr.txt

Fix would be to add subject commonName from CSR only if it is not empty.

image
主要言語
Go
スター
4.3k
フォーク
320
平均マージ
2日 3時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

smallstep/cli のほかの issue

smallstep/cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。