带有ED25519证书文件的Erlang TLS



我正在使用裸Erlangssl: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, [file: 'pubkey_cert_records.erl', line: 228]}, 
{:pubkey_cert_records, :decode_tbs, 1, [file: 'pubkey_cert_records.erl', line: 325]}, 
{:pubkey_cert_records, :decode_cert, 1, [file: 'pubkey_cert_records.erl', line: 42]}, 
{:public_key, :pkix_decode_cert, 2, [file: 'public_key.erl', line: 380]}, 
{:ssl_handshake, :get_cert_params, 1, [file: 'ssl_handshake.erl', line: 1613]}, 
{:tls_handshake_1_3, :get_certificate_params, 1, [file: 'tls_handshake_1_3.erl', line: 2245]}, 
{:tls_handshake_1_3, :do_start, 2, [file: 'tls_handshake_1_3.erl', line: 638]}
]
}

而且我的代码与RSA证书配合使用也非常好。

感谢的帮助

OTP 23及以下版本似乎真的不支持它。

计划将其包含在OTP 24.0版本中。请参阅GitHub问题https://github.com/erlang/otp/issues/4637

最新更新