【问题标题】:Erlang TLS with ED25519 certfile带有 ED25519 证书文件的 Erlang TLS
【发布时间】:2021-06-14 02:59:33
【问题描述】:

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

感谢您的帮助

【问题讨论】:

    标签: erlang tls1.3 ed25519


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2014-05-05
      • 2021-09-20
      • 1970-01-01
      • 2019-03-13
      • 2015-02-09
      • 2018-12-23
      • 1970-01-01
      • 2019-10-01
      • 2019-02-28
      相关资源
      最近更新 更多