Updated 关于证书和TLS支持 (markdown)

Sun Yimin 2025-03-03 11:15:56 +08:00
parent 5ece65bc8b
commit 44e5147592

@ -29,8 +29,11 @@ Golang 在`x509.Certificate`中引入了新字段(忽略简单字段)
### 解决方案
#### 方案一
重新定义`Certificate`,不再是简单的类型定义`type Certificate x509.Certificate`,而是拷贝`x509.Certificate`完整结构,这样的话,在两者之间转换成本就偏高。
重新定义`Certificate`,不再是简单的类型定义`type Certificate x509.Certificate`,而是拷贝`x509.Certificate`完整结构,或者扩展`x509.Certificate`结构,这样的话,在两者之间转换成本就偏高。
#### 方案二
彻底抛弃原来的实现,放弃支持非国密,这个改动可能成本更高,且有上游的兼容性问题。
这个等有实际case需要support的时候再考虑吧。至于为什么要引入`x509.OID`可以参考golang的issue #60665 crypto/x509: introduce new robust OID type & use it for certificate policies.