On this page
ssl.Options
Prev: ssl.namedtuple | Up: ssl | Next: ssl.PEM_cert_to_DER_cert
Rel: ssl.AlertDescription, ssl.cert_time_to_seconds, ssl.CertificateError, ssl.create_connection
Ref: docs.python.org — ssl.Options
Tags: #public #python3 #stdlib #ssl
Import
import ssl
from ssl import Options
Signature & Overview
ssl.Options(*values)
An enumeration.
Methods & Attributes
Options.as_integer_ratio(self, /)— Return a pair of integers, whose ratio is equal to the original int.Options.bit_count(self, /)— Number of ones in the binary representation of the absolute value of self.Options.bit_length(self, /)— Number of bits necessary to represent self in binary.Options.conjugate(self, /)— Returns self, the complex conjugate of any int.Options.from_bytes(bytes, byteorder='big', *, signed=False)— Return the integer represented by the given array of bytes.Options.is_integer(self, /)— Returns True. Exists for duck type compatibility with float.is_integer.Options.to_bytes(self, /, length=1, byteorder='big', *, signed=False)— Return an array of bytes representing an integer.
Usage
import ssl
ctx = ssl.create_default_context()
ctx.options |= ssl.Options.OP_NO_TLSv1
assert isinstance(ssl.Options.OP_NO_TLSv1, ssl.Options)
Gotchas
- Prefer
ctx.minimum_version = ssl.TLSVersion.TLSv1_2over manually togglingOP_NO_TLSv1*option bits.
REPL Inspect
from ssl import Options
help(Options)
Linked from
Related notes
- tuts/python3/stdlib_module/ssl/namedtuple Linked here; links to this page; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/PEM_cert_to_DER_cert Linked here; links to this page; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/ssl/AlertDescription Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/cert_time_to_seconds Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/CertificateError Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/create_connection Linked here; shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/create_default_context shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/DefaultVerifyPaths shared tags: #ssl, #stdlib
- tuts/python3/stdlib_module/ssl/DER_cert_to_PEM_cert shared tags: #ssl, #stdlib