使用pyopenssl为httplib和urllib2提供增强的https支持

ndg-httpsclient的Python项目详细描述


的https客户端实现
  • httplib(python 2)、http.client(python 3)和
  • urllib2(python 2)和urllib(python 3)

…基于pyopenssl。pyopenssl提供了一个功能更全面的ssl实现 超过python提供的默认值,而且重要的是,它支持完全验证 使用pyasn1的ssl对等方。

释放量

0.5.1

  • Clean up handling for description file - pull in content from this file into setup()
  • Allows the nightly build to fail
  • Add Trove version classifiers to make it explicit what is supported
  • Add python_requires to help pip
  • Drop support for EOL Python 2.6 and 3.3

感谢@hugovk的贡献

0.5.0

  • Fix to Subject Alternative Name handling to allow for certificates with more than 64 names (max now 1024). Thanks to Matt Pegler
  • Fix to subjectAltName string to use byte type for correct matching
  • Updated SSL Context objects to default to TLS 1.2

0.4.4

  • Updated test certificates

0.4.3

0.4.2

  • Fix to bug in ^{tt13}$ - duplicate open call. Nb. This bug and the fix DO NOT affect the ^{tt14}$ interfaces that this package provides.

0.4.1

  • Added explicit ref to Python 3 in classifier text for Python 3 checking tools.
  • Moved LICENSE file into package

0.4.0

  • Made dual compatible with Python 2 / 3.

0.3.3

  • Fix to add in AnotherName for ^{tt15}$ field - added for support for CACert issued certs (thanks to Gu1).
  • Fix to HTTP Basic Auth option for ^{tt16}$
  • Fix to ^{tt17}$ so that it can pass a function-based callback instead of using ^{tt18}$. In newer versions of OpenSSL (>= 0.14) the latter failed because of a request for ^{tt19}$ attribute.

0.3.2

  • Fix to SubjectAltNames support check - should only be enabled if pyasn1 is installed.
  • Fix to open_url: HTTP Request object was being created inside if headers is None block - now corrected to create regardless.
  • Added http basic auth support to script. (Thanks to Willem van Engen)

0.3.1

  • extended utils functions to support keyword for passing additional ^{tt3}$ handlers.

0.3.0

  • Added ^{tt21}$ function and added parameter for data to post in ^{tt22}$ and ^{tt23}$ methods.
  • fix to ndg.httpsclient.utils module _should_use_proxy and open_url functions

0.2.0

  • added support for SSL verification with subjectAltNames using pyasn1
  • fixed minor bug - SSL cert DN prefix matching

0.1.0

初始版本

先决条件

这是针对python 2.7和pyopenssl 0.13开发和测试的。 和0.14。0.4.0版使用pyOpenSSL0.15.1和python 2.7进行了测试,并且 3.4条。 ^使用subjectAltNames进行正确的ssl验证需要{tt5}$。

安装

可以使用easy_installpip执行安装。

运行ndg_httpclient

使用http或https从指定url获取数据的简单脚本。

参数:

url
要获取的资源的url

选项:

-h,--help
显示帮助消息并退出.< /dD>
-c FILE, --certificate=FILE
证书文件-默认为$HOME/credentials.pem
-k FILE, --private-key=FILE
私钥文件-默认为证书文件
-t DIR, --ca-certificate-dir=DIR
受信任的CA证书文件目录。
-d,--debug
打印调试信息-这在解决http或 对服务器的https访问。
-p FILE, --post-data-file=FILE
发布数据文件
-f FILE, --fetch=FILE
输出文件
-n,--no-verify-peer
跳过对等证书的验证。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
实现接口方法时不允许java@Override   使用BuffereImage加载映像时java高ram使用率   java For循环混乱,为什么不是循环?   java Android网格视图字符串对齐问题   java如何将方法与比较类型的附加功能进行比较?   在Java Swing中放置JSepator后的间隙大小   java如何避免并发访问我的网站中的支付链接   java如何从现有的Unix服务器连接到FTP服务器?   Spring中的java用户相关bean定义   带有scribesjava库的wordpress Woocommerce REST API返回消费者密钥参数缺失错误消息   java我可以自动检测特定设备连接的串行端口吗?   Javafx棋盘游戏   java使用JTextPane显示HTML,支持SVG吗?   SpringBoot如何在java中将映射转换为实体对象?   如何使用java代码对xls文件进行密码保护   Java JPA(EclipseLink)如何在持久化实际实体之前接收下一个生成的值?   Javaservlet启动外部进程