gpt4 book ai didi

python - 确定 SSL 包使用的默认协议(protocol)版本?

转载 作者:太空宇宙 更新时间:2023-11-03 13:36:06 24 4
gpt4 key购买 nike

在 python 中,如何确定 SSL 包或请求默认使用哪个 SSL 或 TLS 协议(protocol)。

比如 TLSv1 与 SSLv3。

最佳答案

SSL socket creation Python 文档的部分包含有关 SSL 包的信息:

The parameter ssl_version specifies which version of the SSL protocol to use. Typically, the server chooses a particular protocol version, and the client must adapt to the server’s choice. Most of the versions are not interoperable with the other versions. If not specified, the default is PROTOCOL_SSLv23 it provides the most compatibility with other versions.

Here’s a table showing which versions in a client (down the side) can connect to which versions in a server (along the top):

| client / server | SSLv2 | SSLv3 | SSLv23 | TLSv1 | TLSv1.1 | TLSv1.2 |
|-----------------|-------|-------|--------|-------|---------|---------|
| SSLv2 | yes | no | yes | no | no | no |
| SSLv3 | no | yes | yes | no | no | no |
| SSLv23 | no | yes | yes | yes | yes | yes |
| TLSv1 | no | no | yes | yes | no | no |
| TLSv1.1 | no | no | yes | no | yes | no |
| TLSv1.2 | no | no | yes | no | no | yes |

Note:

Which connections succeed will vary depending on the version of OpenSSL. For example, before OpenSSL 1.0.0, an SSLv23 client would always attempt SSLv2 connections.

关于python - 确定 SSL 包使用的默认协议(protocol)版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39862559/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com