[New-bugs-announce] [issue31372] Add SSLSocket.get_verify_result()

Christian Heimes report at bugs.python.org
Wed Sep 6 17:49:04 EDT 2017

New submission from Christian Heimes:

It might be useful to expose SSL_get_verify_result, https://wiki.openssl.org/index.php/Manual:SSL_get_verify_result(3) . The function returns the last verification error of 0 for no error. Application could still verify the chain with verify_mode = CERT_NONE.

>>> import socket, ssl
>>> ctx = ssl.SSLContext()
>>> s = ctx.wrap_socket(socket.socket())
>>> s.connect(('www.python.org', 443))
>>> s._sslobj._sslobj.get_verify_result()
(20, 'unable to get local issuer certificate')

assignee: christian.heimes
components: SSL
messages: 301526
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Add SSLSocket.get_verify_result()
type: enhancement
versions: Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list