python中ssl认证是什么?

1、说明

该模块为客户端和服务器端的网络套接字提供对传输层安全性(通常称为“安全套接字层”)的加密和对等身份验证功能的访问。该模块使用OpenSSL库。只要在这个平台上安装了OpenSSL,就可以在所有现代的Unix系统、Windows、MacOSX等平台上使用。

2、接口

提供了这样一个类。

classSSLSocket(socket):
"""Thisclassimplementsasubtypeofsocket.socketthatwraps
theunderlyingOSsocketinanSSLcontextwhennecessary,and
providesreadandwritemethodsoverthatchannel."""

def__init__(self,sock=None,keyfile=None,certfile=None,
server_side=False,cert_reqs=CERT_NONE,
ssl_version=PROTOCOL_TLS,ca_certs=None,
do_handshake_on_connect=True,
family=AF_INET,type=SOCK_STREAM,proto=0,fileno=None,
suppress_ragged_eofs=True,npn_protocols=None,ciphers=None,
server_hostname=None,
_context=None):

以上就是python中ssl认证的介绍,希望能对大家有所帮助。更多Python学习指路:Python基础教程

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。