使用openssl源码目录demos/bio下的测试代码,当指定支持的签名算法时,会出现如下所示的问题,报错Handshake failure 40,并提示不支持列出的签名算法。
(1)这个报错的原因是因为libcrypto不支持该签名算法吗?我查看了openssl对于签名和hash算法的支持,是包括ECDSA和SHA512的
(2)在wireshark截获的报文中,为何无法看到服务端选择的签名算法
当我删除掉配置文件中对于签名算法的指定,发现能够正常建立TLS连接。我观察整个建立连接过程的报文,无法定位服务端到底选择了哪一个签名算法。
附:
1.客户端的配置文件
# Example configuration file
# Comment out the next line to ignore configuration errors
# config_diagnostics = 1
# Connects to the default port of s_server
Connect = localhost:4433
# Disable TLS v1.2 for test.
# Protocol = ALL, -TLSv1.2
# Only support 3 curves
Curves = P-521:P-384:P-256
# Restricted signature algorithms
SignatureAlgorithms = ECDSA+SHA512
# RSA+SHA512:ECDSA+SHA512
2.服务端的配置文件
# Example configuration file
# Comment out the next line to ignore configuration errors
# config_diagnostics = 1
# Port to listen on
Port = 4433
# Disable TLS v1.2 for test.
# Protocol = ALL, -TLSv1.2
# Only support 3 curves
Curves = P-521:P-384:P-256
# Restricted signature algorithms
SignatureAlgorithms = ECDSA+SHA512
#RSA+SHA512:ECDSA+SHA512
Certificate=server.pem
PrivateKey=server.pem
ChainCAFile=root.pem
VerifyCAFile=root.pem
# Request certificate
VerifyMode=Request
ClientCAFile=root.pem