openssl - 是否有 SSL_get_current_cipher 的 pyOpenSSL 包装器?

标签 openssl pyopenssl

这是一种获取用于连接的实际密码套件的方法吗? get_cipher_list 似乎返回客户端(或服务器)支持的“可能”密码套件。

最佳答案

from OpenSSL._util import (
ffi as _ffi,
lib as _lib)

...

c_cipher_obj = _lib.SSL_get_current_cipher(con._ssl)
cur_cipher = _ffi.string( _lib.SSL_CIPHER_get_name(c_cipher_obj))

其中“con”是已用于连接到服务器或进行握手的 OpenSSL.SSL.Connection 对象。

我不知道为什么pyOpenSSL开发者没有添加这个方法。 M2Crypto 确实有它。

关于openssl - 是否有 SSL_get_current_cipher 的 pyOpenSSL 包装器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18403403/

相关文章:

python - 无法加载公钥

windows - OpenSSL Windows x64 编译错误

c++ - 如何使用相应的 X509 证书验证私有(private) RSA 签名

ssl - 从字符串而不是从文件加载 SSL CA

ruby-on-rails - 使用客户端证书和 TLS_RSA_WITH_AES_256_CBC_SHA 和其他密码套件

c - gdb单步执行动态函数

openssl - 尝试使用此代码通过 TLS 运行 TLS 时,为什么会出现握手失败?

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

python - 代理后面的 https GET 使用 wget + TLSv1 成功,但即使 ssl 协议(protocol)被强制为 TLSv1,请求也会失败

python - OpenSSL.crypto.Error : [] in SignedJwtAssertionCredentials attempt