TwistedPython如何创建证书选项的可接受密码列表?

2024-09-26 04:53:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在努力创建一个iCipher对象的列表以传递到我的ssl.Certificate选项作为我可接受的密码。我想传入一个逗号分隔的字符串(密码名)列表,然后从那里构建密码列表。比如:

from twisted.internet._sslverify import OpenSSLCipher
cipherList = "KRB5-IDEA-CBC-SHA,SEED-SHA"
mySupportedCiphers = []
for cipher in cipherList.split(","):
                    mySupportedCiphers.append(OpenSSLCipher(cipher))

。。。。 菌丝体点=ssl.Certificate选项(可接受密码=我支持的密码)

或者/另外,根据Twisted Docs返回使用中的TLS实现支持的默认/完整密码列表的一种方法

我很抱歉,如果这听起来含糊不清-我们正在试图确定为什么我的邮件接收者可以成功地通过TLS与我们的一个系统连接,而不是另一个。。。看起来这和密码有关,但我的理解是有限的,所以我们(我!)我在探索。。。。在

一如既往的感谢!:)


Tags: 对象字符串密码ssl列表选项tlscertificate
1条回答
网友
1楼 · 发布于 2024-09-26 04:53:24

一种方法是使用^{}.fromOpenSSLCipherString构造函数。在

from twisted.internet.ssl import AcceptableCiphers

cipherListString = "KRB5-IDEA-CBC-SHA,SEED-SHA".replace(",", ":")

acceptableCiphers = AcceptableCiphers.fromOpenSSLCipherString(cipherListString)

options = CertificateOptions(..., acceptableCiphers=acceptableCiphers)

相关问题 更多 >