[GH-ISSUE #1072] IP 证书的 CSR 不应包含 Common Name #724

Closed
opened 2026-03-03 01:05:30 +03:00 by kerem · 10 comments
Owner

Originally created by @ZeroClover on GitHub (Dec 1, 2025).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/1072

Release Version / 软件版本

0.4.7

Description / 缺陷描述

默认情况下,Lego 会将第一个 SAN 作为 CN 用于生成 CSR

但是,当第一个 SAN 为 IP 地址时,CSR 中的 CN 将为 IP 地址,而 Let's Encrypt 将拒绝这样的 CSR

failed to obtain certificate: error: one or more domains had a problem: 1.1.1.1: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/finalize/REDACTED/REDACTED :: urn:ietf:params:acme:error:badCSR :: Error finalizing order :: CSR contains IP address in Common Name

Steps to reproduce / 复现步骤

  1. 使用 LE 作为 CA 申请 IP 证书

Logs / 日志

failed to obtain certificate: error: one or more domains had a problem: 1.1.1.1: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/finalize/REDACTED/REDACTED :: urn:ietf:params:acme:error:badCSR :: Error finalizing order :: CSR contains IP address in Common Name

Miscellaneous / 其他

Lego 已经实现了一个 Option 用于禁用在 CSR 中使用 CN

https://github.com/go-acme/lego/pull/2570/commits/ab48ad18d46d9d0df20208e2e29540e7c8d6c017

考虑对 Profile 为 tlsservershortlived 时自动使用该选项,因为签发出来的证书本来就不包含 CN,在 CSR 中包含 CN 是无意义的

Contribution / 贡献代码

  • I am interested in contributing a PR for this! / 我乐意为此提交代码并发起 PR!
Originally created by @ZeroClover on GitHub (Dec 1, 2025). Original GitHub issue: https://github.com/certimate-go/certimate/issues/1072 ### Release Version / 软件版本 0.4.7 ### Description / 缺陷描述 默认情况下,Lego 会将第一个 SAN 作为 CN 用于生成 CSR 但是,当第一个 SAN 为 IP 地址时,CSR 中的 CN 将为 IP 地址,而 Let's Encrypt 将拒绝这样的 CSR ```console failed to obtain certificate: error: one or more domains had a problem: 1.1.1.1: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/finalize/REDACTED/REDACTED :: urn:ietf:params:acme:error:badCSR :: Error finalizing order :: CSR contains IP address in Common Name ``` ### Steps to reproduce / 复现步骤 1. 使用 LE 作为 CA 申请 IP 证书 ### Logs / 日志 <details> ```console failed to obtain certificate: error: one or more domains had a problem: 1.1.1.1: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/finalize/REDACTED/REDACTED :: urn:ietf:params:acme:error:badCSR :: Error finalizing order :: CSR contains IP address in Common Name ``` </details> ### Miscellaneous / 其他 Lego 已经实现了一个 Option 用于禁用在 CSR 中使用 CN https://github.com/go-acme/lego/pull/2570/commits/ab48ad18d46d9d0df20208e2e29540e7c8d6c017 考虑对 Profile 为 `tlsserver` 和 `shortlived` 时自动使用该选项,因为签发出来的证书本来就不包含 CN,在 CSR 中包含 CN 是无意义的 ### Contribution / 贡献代码 - [ ] I am interested in contributing a PR for this! / 我乐意为此提交代码并发起 PR!
kerem 2026-03-03 01:05:30 +03:00
Author
Owner

@fudiwei commented on GitHub (Dec 1, 2025):

但是,当第一个 SAN 为 IP 地址时,CSR 中的 CN 将为 IP 地址,而 Let's Encrypt 将拒绝这样的 CSR

目前 Certimate 并不支持申请 IP 证书。你是在哪个环节看到这样的 CSR 的?

<!-- gh-comment-id:3596099727 --> @fudiwei commented on GitHub (Dec 1, 2025): > 但是,当第一个 SAN 为 IP 地址时,CSR 中的 CN 将为 IP 地址,而 Let's Encrypt 将拒绝这样的 CSR 目前 Certimate 并不支持申请 IP 证书。你是在哪个环节看到这样的 CSR 的?
Author
Owner

@ZeroClover commented on GitHub (Dec 1, 2025):

目前 Certimate 并不支持申请 IP 证书。你是在哪个环节看到这样的 CSR 的?

我的 Let's Encrypt 账号已经在 IP 证书测试白名单了所以尝试了下用 Certimate 来申请 IP 证书
另外,用 LE Staging API 也可以申请 IP 证书吧

<!-- gh-comment-id:3596108484 --> @ZeroClover commented on GitHub (Dec 1, 2025): > 目前 Certimate 并不支持申请 IP 证书。你是在哪个环节看到这样的 CSR 的? 我的 Let's Encrypt 账号已经在 IP 证书测试白名单了所以尝试了下用 Certimate 来申请 IP 证书 另外,用 LE Staging API 也可以申请 IP 证书吧
Author
Owner

@fudiwei commented on GitHub (Dec 1, 2025):

在 Let's Encrypt 生产环境就绪 IP 证书之前,没有仅支持其测试环境的计划。

届时会根据实际情况重新组织代码,可以预期的是会有许多变化。

<!-- gh-comment-id:3596192376 --> @fudiwei commented on GitHub (Dec 1, 2025): 在 Let's Encrypt 生产环境就绪 IP 证书之前,没有仅支持其测试环境的计划。 届时会根据实际情况重新组织代码,可以预期的是会有许多变化。
Author
Owner

@fudiwei commented on GitHub (Dec 1, 2025):

这个 Issue 暂时不会被关闭,但也不会被视作一个缺陷而修复。你可以在此追踪后续进度 😄

<!-- gh-comment-id:3596193275 --> @fudiwei commented on GitHub (Dec 1, 2025): 这个 Issue 暂时不会被关闭,但也不会被视作一个缺陷而修复。你可以在此追踪后续进度 😄
Author
Owner

@ZeroClover commented on GitHub (Dec 2, 2025):

在 Let's Encrypt 生产环境就绪 IP 证书之前,没有仅支持其测试环境的计划。

届时会根据实际情况重新组织代码,可以预期的是会有许多变化。

其实已经在生产 API 了,只是目前需要申请白名单才能用(和之前中间证书 ECC 一样)

<!-- gh-comment-id:3601836352 --> @ZeroClover commented on GitHub (Dec 2, 2025): > 在 Let's Encrypt 生产环境就绪 IP 证书之前,没有仅支持其测试环境的计划。 > > 届时会根据实际情况重新组织代码,可以预期的是会有许多变化。 其实已经在生产 API 了,只是目前需要申请白名单才能用(和之前中间证书 ECC 一样)
Author
Owner

@ZeroClover commented on GitHub (Dec 17, 2025):

在 Let's Encrypt 生产环境就绪 IP 证书之前,没有仅支持其测试环境的计划。

届时会根据实际情况重新组织代码,可以预期的是会有许多变化。

根据 https://community.letsencrypt.org/t/upcoming-changes-to-let-s-encrypt-certificates/243873

Short-lived 配置文件和 IP 证书现已正式上线,并对所有用户开放

<!-- gh-comment-id:3663387841 --> @ZeroClover commented on GitHub (Dec 17, 2025): > 在 Let's Encrypt 生产环境就绪 IP 证书之前,没有仅支持其测试环境的计划。 > > 届时会根据实际情况重新组织代码,可以预期的是会有许多变化。 根据 https://community.letsencrypt.org/t/upcoming-changes-to-let-s-encrypt-certificates/243873 Short-lived 配置文件和 IP 证书现已正式上线,并对所有用户开放
Author
Owner

@JavaSCU commented on GitHub (Dec 19, 2025):

Let's Encrypt已正式支持,请求支持,谢谢

failed to obtain certificate: error: one or more domains had a problem: 67.104.199.111: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/finalize/2849740656/460403218616 :: urn:ietf:params:acme:error:badCSR :: Error finalizing order :: CSR contains IP address in Common Name

<!-- gh-comment-id:3674344280 --> @JavaSCU commented on GitHub (Dec 19, 2025): Let's Encrypt已正式支持,请求支持,谢谢 failed to obtain certificate: error: one or more domains had a problem: 67.104.199.111: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/finalize/2849740656/460403218616 :: urn:ietf:params:acme:error:badCSR :: Error finalizing order :: CSR contains IP address in Common Name
Author
Owner

@eallion commented on GitHub (Dec 19, 2025):

👀

<!-- gh-comment-id:3674908575 --> @eallion commented on GitHub (Dec 19, 2025): 👀
Author
Owner

@dianso commented on GitHub (Dec 19, 2025):

等IP证书,感谢。

<!-- gh-comment-id:3675237994 --> @dianso commented on GitHub (Dec 19, 2025): 等IP证书,感谢。
Author
Owner

@fudiwei commented on GitHub (Dec 26, 2025):

v0.4.11 起已支持。

<!-- gh-comment-id:3692621755 --> @fudiwei commented on GitHub (Dec 26, 2025): [v0.4.11](https://github.com/certimate-go/certimate/releases/v0.4.11) 起已支持。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#724
No description provided.