openssl生成ecdsa和dss证书以及ecdsa证书在s_server中可以正常使用的方法

佛曰不可说,一是无法说,一是说不得。多言无意,充其量只是在无法连接的平静中创造一点波动,或许可以接续,大多数缺只是搅动一颗妄心。

生成ecdsa证书私钥:

openssl ecparam -name sect233k1 -out sect233k1_ca
openssl ecparam -in sect233k1_ca -genkey -noout -out ca.key

生成dss证书私钥:

openssl dsaparam -out dsaparam_ca 2048
openssl gendsa -out ca.key dsaparam_ca

在openssl最新版本(1.1.1g)中,对curve好像做了一些筛选,默认不再支持一些历史curve(列表目前还没有获取到),s_server和s_client要使用这些curve生成的ecdsa证书,默认会提示40错误:no shared cipher,此时需要显式指定curve,形如:

openssl s_server -state -accept 9999 -verify 1 -cert server.pem -key server.key -CAfile ca.pem  -curves "sect233k1" -tls1_2 -cipher ECDHE-ECDSA-AES256-GCM-SHA384
openssl s_client -connect 127.0.0.1:9999 -verify 1 -CAfile ca.pem  -curves "sect233k1" -cipher ECDHE-ECDSA-AES256-GCM-SHA384 -tls1_2

另外最新的openssl对cipher的指定做了变化,-cipher用来指定tls1.2和以下版本的cipher,-ciphersuites用来指定tls1.3版本的cipher

参考:

https://github.com/openssl/openssl/issues/5146

openssl生成ecdsa和dss证书以及ecdsa证书在s_server中可以正常使用的方法》有1个想法

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据