python - M2Crypto Common Name字段和ip关系

标签 python ssl m2crypto

我使用 M2Crypto,客户端和服务器都添加了 key 和证书,没有权限!!! 现在我发现该字段 Common Name 应该设置为 domain 或任何东西,只要它在两边是相同的。 如果 key 没有与其 ip 相同的 Common Name 字段,当 python 脚本是 sun 时,我会遇到问题,它将无法工作。 machine ip和Common Name字段之间有什么联系',因为我没有使用权限吗?

最佳答案

您可能对 this answer 感兴趣我给了一个类似的问题:

应如何进行主机名验证在 RFC 6125 中定义,这是最近的并将实践推广到所有协议(protocol),并取代了 RFC 2818 ,这是特定于 HTTPS 的。 (我什至不确定 Java 7 使用 RFC 6125,这可能太新了。)

来自 RFC 2818 (Section 3.1) :

If a subjectAltName extension of type dNSName is present, that MUST be used as the identity. Otherwise, the (most specific) Common Name field in the Subject field of the certificate MUST be used. Although the use of the Common Name is existing practice, it is deprecated and Certification Authorities are encouraged to use the dNSName instead.

[...]

In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must be present in the certificate and must exactly match the IP in the URI.

本质上(至少对于 HTTPS,但这也被推广到其他协议(protocol)),您并不打算将 IP 地址放在主题 DN 的通用名称中,它应该放在 IP 主题备用名称条目中。 (一些浏览器对此非常灵活。)

关于python - M2Crypto Common Name字段和ip关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9604935/

相关文章:

python - 在 wxPython 中创建一个滚动面板

python - M2Crypto:从不透明签名的 S/MIME (pkcs7-mime) 中提取消息

python - 64 位 centos m2crypto 在 load_key 期间崩溃

python - Python 对 PEM + RSA + DES3 的支持在哪里?

python - 如何使用 keras.backend.gradients() 获取梯度值

python - 使用 Python 进行优化 (scipy.optimize)

python - 字符串列表中的模式匹配,在 Pandas 中创建新列

php - 如何在 ubuntu 服务器上安装多个客户端证书?

带有宽卡证书的 iOS POST HTTPS 请求

node.js - 通过 Mongoose.js 使用 SSL 和 mongos 连接到 Compose.io MongoDB 部署