您现在的位置是:课程教程文章

python中ssl认证是什么?

2023-12-14 22:12课程教程文章 人已围观

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电脑。

课程教程:python中ssl认证是什么?

上一篇:python函数装饰器的应用过程

下一篇:没有了

站点信息

  • 文章统计篇文章