问题描述
我正在使用裸 Erlang ssl:listen/2
函数创建服务器代码。我想使用使用 ED25519 算法的 TLS 证书,但服务器在握手时崩溃。通过挖掘 Erlang 代码,似乎 TLS 不支持此算法(它在此函数上崩溃:https://github.com/erlang/otp/blob/master/lib/public_key/src/pubkey_cert_records.erl#L109)。
这是正确的还是我做错了什么?有没有办法启用对它的支持?一些解决方法?
作为参考,这是我生成证书的方式:
openssl genpkey -algorithm ED25519 -out key.pem
openssl req -new -x509 -days 1825 -key key.pem -out cert.pem
这是我得到的崩溃数据:
{
:function_clause,[
{:pubkey_cert_records,:supportedPublicKeyAlgorithms,[{1,3,101,112}],[file: 'pubkey_cert_records.erl',line: 109]},{:pubkey_cert_records,:decode_supportedPublicKey,1,line: 228]},:decode_tbs,line: 325]},:decode_cert,line: 42]},{:public_key,:pkix_decode_cert,2,[file: 'public_key.erl',line: 380]},{:ssl_handshake,:get_cert_params,[file: 'ssl_handshake.erl',line: 1613]},{:tls_handshake_1_3,:get_certificate_params,[file: 'tls_handshake_1_3.erl',line: 2245]},:do_start,line: 638]}
]
}
而且我的代码与 RSA 证书一起工作得很好。
感谢您的帮助
解决方法
似乎真的不支持 OTP 23 及以下版本。
计划包含在 OTP 24.0 版本中。请参阅 GitHub 问题 https://github.com/erlang/otp/issues/4637