On this page
  1. ssl.SSLObject
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

ssl.SSLObject

Prev: ssl.SSLErrorNumber | Up: ssl | Next: ssl.SSLSession
Rel: ssl.AlertDescription, ssl.cert_time_to_seconds, ssl.CertificateError, ssl.create_connection
Ref: docs.python.org — ssl.SSLObject
Tags: #public #python3 #stdlib #ssl


Import

import ssl
from ssl import SSLObject

Signature & Overview

ssl.SSLObject(*args, **kwargs)

This class implements an interface on top of a low-level SSL object as implemented by OpenSSL. This object captures the state of an SSL connection but does not provide any network IO itself. IO needs to be performed

Methods & Attributes

Usage

import ssl

ctx = ssl.create_default_context()
in_bio, out_bio = ssl.MemoryBIO(), ssl.MemoryBIO()
obj = ctx.wrap_bio(in_bio, out_bio, server_hostname="example.com")
assert isinstance(obj, ssl.SSLObject)

Gotchas

REPL Inspect

from ssl import SSLObject
help(SSLObject)

Linked from

Related notes