品易云推流 关闭
文章详情页
文章 > Python基础教程 > python中ssl认证是什么?

python中ssl认证是什么?

头像

小妮浅浅

2021-05-14 09:57:382804浏览 · 0收藏 · 0评论

1、说明

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

2、接口

提供了这样一个类。

class SSLSocket(socket):
    """This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel."""
 
    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基础教程

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。

关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

底部广告图