python的httplib.HTTPSConnection()会验证客户端服务器的证书吗

暮雨晨舟 2012-09-05 05:14:51
class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]]]]])¶
A subclass of HTTPConnection that uses SSL for communication with secure servers. Default port is 443. key_file is the name of a PEM formatted file that contains your private key. cert_file is a PEM formatted certificate chain file.

Warning:
This does not do any verification of the server’s certificate.

New in version 2.0.

Changed in version 2.6: timeout was added.

Changed in version 2.7: source_address was added.

...全文
435 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
暮雨晨舟 2012-09-06
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 的回复:]
引用 4 楼 的回复:
引用 1 楼 的回复:

class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]]]]])
======================
注意看其参数:从port以后的参数都输可选参数,也就是可以不管的

您说的……
[/Quote]
现在应用就是要求实现双向认证,所以问题就是,用httplib.HTTPSConnection 还能实现吗?
Gloveing 2012-09-05
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]
引用 1 楼 的回复:

class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]]]]])
======================
注意看其参数:从port以后的参数都输可选参数,也就是可以不管的

您说的这个我了解,但是下面的wa……
[/Quote]
不对服务器端的证书做任何验证
暮雨晨舟 2012-09-05
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]]]]])
======================
注意看其参数:从port以后的参数都输可选参数,也就是可以不管的
[/Quote]
您说的这个我了解,但是下面的warning是何解呢

Warning:
This does not do any verification of the server’s certificate.
暮雨晨舟 2012-09-05
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

具体要如何认证?
[/Quote]
SSL双向认证
bugs2k 2012-09-05
  • 打赏
  • 举报
回复
具体要如何认证?
Gloveing 2012-09-05
  • 打赏
  • 举报
回复
class httplib.HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout[, source_address]]]]]])
======================
注意看其参数:从port以后的参数都输可选参数,也就是可以不管的

37,719

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧