且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

扭曲的Python,TLS和客户端/服务器证书身份验证错误

更新时间:2023-10-18 18:20:16

因此,示例代码中似乎有一个错误,该错误位于:

So it looks like there is a bug in the sample code found at: http://twistedmatrix.com/documents/14.0.0/core/howto/ssl.html

以示例"echoclient_ssl.py"为例:

Looking at the example "echoclient_ssl.py" there is the line:

authority = ssl.Certificate.loadPEM(certData)

但是,"starttls_client.py"示例代码中的等效代码是:

However, the equivalent bit of code in the "starttls_client.py" example code is:

ssl.PrivateCertificate.loadPEM(certData)

客户端上的

PrivateCertificate?即使我对TLS的了解有限,这似乎还是错误的.确实,我修改了代码以删除私人" ...,以上错误消失了!

PrivateCertificate on the client side? Even with my limited understanding of TLS, this seems wrong. Indeed, I modified my code to remove the "Private"... and the error above disappears!

正如我所说,我的知识和理解正在这里增长-但这肯定是我问题的解决方案!

As I say, my knowledge and understanding is growing here - but this certainly seems to be the issue / solution to my question!