Skip to content

Commit 3517ad8

Browse files
authored
feat: add None in gen_cert.policy (#2773)
Signed-off-by: redscholar <blacktiledhouse@gmail.com>
1 parent 9b1bd9f commit 3517ad8

File tree

2 files changed

+164
-130
lines changed

2 files changed

+164
-130
lines changed

docs/zh/modules/gen_cert.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ gen_cert模块允许用户校验或生成证书文件。
99
| root_key | CA证书的key路径 | 字符串 || - |
1010
| root_cert | CA证书路径 | 字符串 || - |
1111
| date | 证书过期时间 | 字符串 || 1y |
12-
| policy | 证书生成策略(Always, IfNotPresent) | 字符串 || IfNotPresent |
12+
| policy | 证书生成策略(Always, IfNotPresent, None| 字符串 || IfNotPresent |
1313
| sans | Subject Alternative Names. 允许的IP和DNS | 字符串 || - |
1414
| cn | Common Name | 字符串 || - |
1515
| out_key | 生成的证书key路径 | 字符串 || - |
1616
| out_cert | 生成的证书路径 | 字符串 || - |
1717

18-
证书生成策略:
19-
Always: 无论`out_key``out_cert`指向的证书路径是否存在,都会生成新的证书进行覆盖。
20-
IfNotPresent: 当`out_key``out_cert`指向的证书路径存在时,只对该证书进行校验,并不会生成新的证书。
18+
证书生成策略说明:
19+
20+
- **Always**:无论`out_key``out_cert`指定的证书文件是否已存在,始终重新生成证书并覆盖原有文件。
21+
- **IfNotPresent**:仅当`out_key``out_cert`指定的证书文件不存在时才生成新证书;如果文件已存在,则先对现有证书进行校验,校验不通过时才会重新生成证书。
22+
- **None**:如果`out_key``out_cert`指定的证书文件已存在,仅对其进行校验,不会生成或覆盖证书文件;若文件不存在则不会生成新证书。
23+
24+
该策略可灵活控制证书的生成和校验行为,满足不同场景下的需求。
2125

2226
## 使用示例
2327

0 commit comments

Comments
 (0)