python - 如何修复 SSL 问题 SSL_CTX_use_certificate : ca md too weak on Python Zeep

标签 python openssl zeep

我的代码之前一直可以工作,直到每当我向 Frontierlink Web 服务发出 SOAP 请求时都会收到此错误。

File "/home/venv/lib/python2.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
raise exception_type(errors)

OpenSSL.SSL.Error: [('SSL 例程', 'SSL_CTX_use_certificate', 'ca md 太弱')]

我是否需要重新生成用于连接的 pem 文件,或者问题出在我用于生成 pem 文件的 .p12 文件上?

如果您需要有关我的问题的更多信息,请告诉我。

注释:

我使用的 OpenSSL 版本是:OpenSSL 1.0.2k-fips

提前谢谢您!

最佳答案

您收到的错误消息表明您使用的证书是使用 md5 哈希签名的。

OpenSSL 1.1.0 引入了一项名为 security level 的新功能.
1 的默认设置将导致以下情况(我强调):

The security level corresponds to a minimum of 80 bits of security. Any parameters offering below 80 bits of security are excluded. As a result RSA, DSA and DH keys shorter than 1024 bits and ECC keys shorter than 160 bits are prohibited. All export cipher suites are prohibited since they all offer less than 80 bits of security. SSL version 2 is prohibited. Any cipher suite using MD5 for the MAC is also prohibited.

您可能需要重新生成证书并使用更强的哈希进行签名,例如 SHA1

OpenSSL Users 的论坛帖子来看现在可能会出现此问题,因为您尝试连接的服务已升级其 OpenSSL 版本,并且现在拒绝您的证书。

关于python - 如何修复 SSL 问题 SSL_CTX_use_certificate : ca md too weak on Python Zeep,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52218876/

相关文章:

python - 获取文本文件名

python - Pandas 根据第三列不是常量的值将值从一列复制到另一列

c - 将 BigNum 与普通整数相乘

python - 创建要传递给 zeep 的 xml 格式

python - 使用 python 请求传递 csrftoken 使用隐藏的输入类型

python - PyQt - 添加文本

node.js - 使用 TLS 协议(protocol)运行 NodeJS

C OpenSSL 登录 POP 邮件服务器

python - 用zeep创建一个字符串数组参数?

Python Zeep - 多个 WSDL 文件