【问题标题】:ee key too small when doing connect in paho mqtt (client certificat)在 paho mqtt(客户端证书)中进行连接时,ee 密钥太小
【发布时间】:2021-11-07 02:56:30
【问题描述】:

我正在使用 paho mqtt 在 ubuntu 20.04 上使用 python3 发送消息。 我正在使用 ssl 版本 2

当我这样做时:

client = mqtt.Client()
client.tls_set(ca_certs=CA_CERT, certfile=CLIENT_CERT, keyfile=CLIENT_KEY)
client.connect(HOST, 8883, 20)

我收到此错误:

     File "/usr/local/lib/python3.8/dist-packages/paho/mqtt/client.py", line 823, in tls_set
  context.load_cert_chain(certfile, keyfile)
ssl.SSLError: [SSL: EE_KEY_TOO_SMALL] ee key too small (_ssl.c:4046)

我的私钥是 1024 位 我无法更改我的客户证书。

请问有什么解决方法吗?

【问题讨论】:

标签: python-3.x openssl ubuntu-20.04 paho


【解决方案1】:

您确实需要颁发新的私钥。我要建议的只是一种临时解决方法。

允许的最小密钥大小由 openssl 配置控制。您应该能够编辑 `/etc/ssl/openssl.cnf 文件以将以下内容添加到末尾:

[system_default_sect] 
CipherString = DEFAULT@SECLEVEL=1 

https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level

https://wiki.debian.org/ContinuousIntegration/TriagingTips/openssl-1.1.1

【讨论】:

    猜你喜欢
    • 2016-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多