INNER CODE UNIT · Python
__init__
pyca/pyopenssl · src/OpenSSL/SSL.py:658
def __init__(self, callback: _OCSPClientCallback[Any]) -> None:
@wraps(callback)
def wrapper(ssl, cdata): # type: ignore[no-untyped-def]
conn = Connection._reverse_mapping[ssl]
try:
# Extract the data if any was provided.
if cdata != _ffi.NULL:
data = _ffi.from_handle(cdata)
else:
data = None
# Get the OCSP data.
ocsp_ptr = _ffi.new("unsigned char **")
ocsp_len = _lib.SSL_get_tlsext_status_ocsp_resp(ssl, ocsp_ptr)
if ocsp_len < 0:
# No OCSP data.
ocsp_data = b""
else: