mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-11 03:26:17 +08:00
Updated 关于证书和TLS支持 (markdown)
parent
44e5147592
commit
0e8b4bc88a
@ -31,6 +31,8 @@ Golang 在`x509.Certificate`中引入了新字段(忽略简单字段):
|
||||
#### 方案一
|
||||
重新定义`Certificate`,不再是简单的类型定义`type Certificate x509.Certificate`,而是拷贝`x509.Certificate`完整结构,或者扩展`x509.Certificate`结构,这样的话,在两者之间转换成本就偏高。
|
||||
|
||||
假设以后Golang在某个版本又新加了新字段,那为了兼容以前的旧版本,在两者转换的时候,还需要通过反射来判断该字段的存在性;或者不转新字段,直到支持的Golang最小版本都支持该字段。
|
||||
|
||||
#### 方案二
|
||||
彻底抛弃原来的实现,放弃支持非国密,这个改动可能成本更高,且有上游的兼容性问题。
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user