2

我正在使用裸 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 证书完美配合。

谢谢你的帮助

4

1 回答 1

1

似乎 OTP 23 及以下版本确实不支持它。

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

于 2021-03-17T12:37:31.593 回答