# curl support TLCP using TASSL
Date: 2024-02-16


#### **TLCP**

传输层密码协议TLCP 对应 TLS协议， 在GB/T 38636-2020规范中定义。支持国密sm2, sm3, sm4密钥套件。增加加密证书， 6.4.5.3章节中提到 选择ECC, ECDHE算法，密钥交换算法使用用加密证书公钥。

> https://blog.csdn.net/shenshaojun/article/details/114576162
> 
> 这里对密钥体系进行了说明， 目前没看到标准里介绍，加密证书CA生成，并拥有私钥。这样的涉及对于信息保密性要依赖CA机构？

 

#### **CURL**

curl工具目前还不支持TLCP，一般需要进行简单修改。 目前支持国密库：

- GMSSL
- Tongsuo 铜锁
- 江南天安TASSL
- TencentKonaSMSuite

curl支持TLCP：

- GMSSL 开源版本 ： https://github.com/pengtianabc/curl-gm
- Tongsuo : https://github.com/Tongsuo-Project/curl

 

#### **CURL compile using TASSL**

具体实现：https://github.com/weida/Curl-with-TASSL-support-for-TLCP

需要注意新版本curl的参数使用二分查找，参数需要自己排序

```
"src/tool_getparam.c" 
/* this array MUST be alphasorted based on the 'lname' */
static const struct LongShort aliases[]= {
...
```

目前测试环境仅有linux版本，只提了个linux patch。

 

#### **参考及引用：**

https://zhuanlan.zhihu.com/p/564452283

https://www.cnblogs.com/anding/p/17627553.html

[图片from陳丁光](https://www.facebook.com/groups/474930279315210/user/100010173011046/?__cft__[0]=AZVrP5od3rfc6bApiDg8eigFWpavmtPxjOpRuZhTFbz2r0BiX9CZGSQD2Ni9IXccFD9zp_LSk0d9JwhK1-l2tKumKrU9s2o0tZPqiNn-chYV_RbnyOYFgOGb5lTPwg2eP7D-dSQEbrGcQCz_dRYVAPTQENePUHkTvnxKlwNOSvEfy6q2cHYs3bMY-7WcVc8tZng&__tn__=-UC*F)

