mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
use SSL_get_session
This commit is contained in:
parent
5318c7aa59
commit
baf7c1e546
1 changed files with 3 additions and 2 deletions
|
|
@ -1404,13 +1404,14 @@ cipher_to_tuple(const SSL_CIPHER *cipher)
|
|||
|
||||
static PyObject *PySSL_shared_ciphers(PySSLSocket *self)
|
||||
{
|
||||
SSL_SESSION *sess = SSL_get_session(self->ssl);
|
||||
STACK_OF(SSL_CIPHER) *ciphers;
|
||||
int i;
|
||||
PyObject *res;
|
||||
|
||||
if (!self->ssl->session || !self->ssl->session->ciphers)
|
||||
if (!sess || !sess->ciphers)
|
||||
Py_RETURN_NONE;
|
||||
ciphers = self->ssl->session->ciphers;
|
||||
ciphers = sess->ciphers;
|
||||
res = PyList_New(sk_SSL_CIPHER_num(ciphers));
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue