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

ssl.SSLContext

Prev: ssl.SSLCertVerificationError | Up: ssl | Next: ssl.SSLEOFError
Rel: ssl.AlertDescription, ssl.cert_time_to_seconds, ssl.CertificateError, ssl.create_connection
Ref: docs.python.org — ssl.SSLContext
Tags: #public #python3 #stdlib #ssl


Import

import ssl
from ssl import SSLContext

Signature & Overview

ssl.SSLContext(protocol=None, *args, **kwargs)

An SSLContext holds various SSL-related configuration options and data, such as certificates and possibly a private key.

Methods & Attributes

Usage

import ssl

ctx = ssl.create_default_context()
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
assert isinstance(ctx, ssl.SSLContext) and ctx.verify_mode == ssl.CERT_REQUIRED

Gotchas

REPL Inspect

from ssl import SSLContext
help(SSLContext)

Linked from

Related notes