doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
ssl.HAS_NPN Whether the OpenSSL library has built-in support for the Next Protocol Negotiation as described in the Application Layer Protocol Negotiation. When true, you can use the SSLContext.set_npn_protocols() method to advertise which protocols you want to support. New in version 3.3.
python.library.ssl#ssl.HAS_NPN
ssl.HAS_SNI Whether the OpenSSL library has built-in support for the Server Name Indication extension (as defined in RFC 6066). New in version 3.2.
python.library.ssl#ssl.HAS_SNI
ssl.HAS_SSLv2 Whether the OpenSSL library has built-in support for the SSL 2.0 protocol. New in version 3.7.
python.library.ssl#ssl.HAS_SSLv2
ssl.HAS_SSLv3 Whether the OpenSSL library has built-in support for the SSL 3.0 protocol. New in version 3.7.
python.library.ssl#ssl.HAS_SSLv3
ssl.HAS_TLSv1 Whether the OpenSSL library has built-in support for the TLS 1.0 protocol. New in version 3.7.
python.library.ssl#ssl.HAS_TLSv1
ssl.HAS_TLSv1_1 Whether the OpenSSL library has built-in support for the TLS 1.1 protocol. New in version 3.7.
python.library.ssl#ssl.HAS_TLSv1_1
ssl.HAS_TLSv1_2 Whether the OpenSSL library has built-in support for the TLS 1.2 protocol. New in version 3.7.
python.library.ssl#ssl.HAS_TLSv1_2
ssl.HAS_TLSv1_3 Whether the OpenSSL library has built-in support for the TLS 1.3 protocol. New in version 3.7.
python.library.ssl#ssl.HAS_TLSv1_3
ssl.match_hostname(cert, hostname) Verify that cert (in decoded format as returned by SSLSocket.getpeercert()) matches the given hostname. The rules applied are those for checking the identity of HTTPS servers as outlined in RFC 2818, RFC 5280 and RFC 6125. In addition to HTTPS, this function should be suitable for c...
python.library.ssl#ssl.match_hostname
class ssl.MemoryBIO A memory buffer that can be used to pass data between Python and an SSL protocol instance. pending Return the number of bytes currently in the memory buffer. eof A boolean indicating whether the memory BIO is current at the end-of-file position. read(n=-1) Read up to n bytes from t...
python.library.ssl#ssl.MemoryBIO
eof A boolean indicating whether the memory BIO is current at the end-of-file position.
python.library.ssl#ssl.MemoryBIO.eof
pending Return the number of bytes currently in the memory buffer.
python.library.ssl#ssl.MemoryBIO.pending
read(n=-1) Read up to n bytes from the memory buffer. If n is not specified or negative, all bytes are returned.
python.library.ssl#ssl.MemoryBIO.read
write(buf) Write the bytes from buf to the memory BIO. The buf argument must be an object supporting the buffer protocol. The return value is the number of bytes written, which is always equal to the length of buf.
python.library.ssl#ssl.MemoryBIO.write
write_eof() Write an EOF marker to the memory BIO. After this method has been called, it is illegal to call write(). The attribute eof will become true after all data currently in the buffer has been read.
python.library.ssl#ssl.MemoryBIO.write_eof
ssl.OPENSSL_VERSION The version string of the OpenSSL library loaded by the interpreter: >>> ssl.OPENSSL_VERSION 'OpenSSL 1.0.2k 26 Jan 2017' New in version 3.2.
python.library.ssl#ssl.OPENSSL_VERSION
ssl.OPENSSL_VERSION_INFO A tuple of five integers representing version information about the OpenSSL library: >>> ssl.OPENSSL_VERSION_INFO (1, 0, 2, 11, 15) New in version 3.2.
python.library.ssl#ssl.OPENSSL_VERSION_INFO
ssl.OPENSSL_VERSION_NUMBER The raw version number of the OpenSSL library, as a single integer: >>> ssl.OPENSSL_VERSION_NUMBER 268443839 >>> hex(ssl.OPENSSL_VERSION_NUMBER) '0x100020bf' New in version 3.2.
python.library.ssl#ssl.OPENSSL_VERSION_NUMBER
class ssl.Options enum.IntFlag collection of OP_* constants.
python.library.ssl#ssl.Options
ssl.OP_ALL Enables workarounds for various bugs present in other SSL implementations. This option is set by default. It does not necessarily set the same flags as OpenSSL’s SSL_OP_ALL constant. New in version 3.2.
python.library.ssl#ssl.OP_ALL
ssl.OP_CIPHER_SERVER_PREFERENCE Use the server’s cipher ordering preference, rather than the client’s. This option has no effect on client sockets and SSLv2 server sockets. New in version 3.3.
python.library.ssl#ssl.OP_CIPHER_SERVER_PREFERENCE
ssl.OP_ENABLE_MIDDLEBOX_COMPAT Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a TLS 1.3 connection look more like a TLS 1.2 connection. This option is only available with OpenSSL 1.1.1 and later. New in version 3.8.
python.library.ssl#ssl.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.OP_IGNORE_UNEXPECTED_EOF Ignore unexpected shutdown of TLS connections. This option is only available with OpenSSL 3.0.0 and later. New in version 3.10.
python.library.ssl#ssl.OP_IGNORE_UNEXPECTED_EOF
ssl.OP_NO_COMPRESSION Disable compression on the SSL channel. This is useful if the application protocol supports its own compression scheme. This option is only available with OpenSSL 1.0.0 and later. New in version 3.3.
python.library.ssl#ssl.OP_NO_COMPRESSION
ssl.OP_NO_RENEGOTIATION Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest messages, and ignore renegotiation requests via ClientHello. This option is only available with OpenSSL 1.1.0h and later. New in version 3.7.
python.library.ssl#ssl.OP_NO_RENEGOTIATION
ssl.OP_NO_SSLv2 Prevents an SSLv2 connection. This option is only applicable in conjunction with PROTOCOL_TLS. It prevents the peers from choosing SSLv2 as the protocol version. New in version 3.2. Deprecated since version 3.6: SSLv2 is deprecated
python.library.ssl#ssl.OP_NO_SSLv2
ssl.OP_NO_SSLv3 Prevents an SSLv3 connection. This option is only applicable in conjunction with PROTOCOL_TLS. It prevents the peers from choosing SSLv3 as the protocol version. New in version 3.2. Deprecated since version 3.6: SSLv3 is deprecated
python.library.ssl#ssl.OP_NO_SSLv3
ssl.OP_NO_TICKET Prevent client side from requesting a session ticket. New in version 3.6.
python.library.ssl#ssl.OP_NO_TICKET
ssl.OP_NO_TLSv1 Prevents a TLSv1 connection. This option is only applicable in conjunction with PROTOCOL_TLS. It prevents the peers from choosing TLSv1 as the protocol version. New in version 3.2. Deprecated since version 3.7: The option is deprecated since OpenSSL 1.1.0, use the new SSLContext.minimum_version and...
python.library.ssl#ssl.OP_NO_TLSv1
ssl.OP_NO_TLSv1_1 Prevents a TLSv1.1 connection. This option is only applicable in conjunction with PROTOCOL_TLS. It prevents the peers from choosing TLSv1.1 as the protocol version. Available only with openssl version 1.0.1+. New in version 3.4. Deprecated since version 3.7: The option is deprecated since OpenSSL...
python.library.ssl#ssl.OP_NO_TLSv1_1
ssl.OP_NO_TLSv1_2 Prevents a TLSv1.2 connection. This option is only applicable in conjunction with PROTOCOL_TLS. It prevents the peers from choosing TLSv1.2 as the protocol version. Available only with openssl version 1.0.1+. New in version 3.4. Deprecated since version 3.7: The option is deprecated since OpenSSL...
python.library.ssl#ssl.OP_NO_TLSv1_2
ssl.OP_NO_TLSv1_3 Prevents a TLSv1.3 connection. This option is only applicable in conjunction with PROTOCOL_TLS. It prevents the peers from choosing TLSv1.3 as the protocol version. TLS 1.3 is available with OpenSSL 1.1.1 or later. When Python has been compiled against an older version of OpenSSL, the flag defaults ...
python.library.ssl#ssl.OP_NO_TLSv1_3
ssl.OP_SINGLE_DH_USE Prevents re-use of the same DH key for distinct SSL sessions. This improves forward secrecy but requires more computational resources. This option only applies to server sockets. New in version 3.3.
python.library.ssl#ssl.OP_SINGLE_DH_USE
ssl.OP_SINGLE_ECDH_USE Prevents re-use of the same ECDH key for distinct SSL sessions. This improves forward secrecy but requires more computational resources. This option only applies to server sockets. New in version 3.3.
python.library.ssl#ssl.OP_SINGLE_ECDH_USE
ssl.PEM_cert_to_DER_cert(PEM_cert_string) Given a certificate as an ASCII PEM string, returns a DER-encoded sequence of bytes for that same certificate.
python.library.ssl#ssl.PEM_cert_to_DER_cert
ssl.PROTOCOL_SSLv2 Selects SSL version 2 as the channel encryption protocol. This protocol is not available if OpenSSL is compiled with the OPENSSL_NO_SSL2 flag. Warning SSL version 2 is insecure. Its use is highly discouraged. Deprecated since version 3.6: OpenSSL has removed support for SSLv2.
python.library.ssl#ssl.PROTOCOL_SSLv2
ssl.PROTOCOL_SSLv23 Alias for PROTOCOL_TLS. Deprecated since version 3.6: Use PROTOCOL_TLS instead.
python.library.ssl#ssl.PROTOCOL_SSLv23
ssl.PROTOCOL_SSLv3 Selects SSL version 3 as the channel encryption protocol. This protocol is not be available if OpenSSL is compiled with the OPENSSL_NO_SSLv3 flag. Warning SSL version 3 is insecure. Its use is highly discouraged. Deprecated since version 3.6: OpenSSL has deprecated all version specific protocols...
python.library.ssl#ssl.PROTOCOL_SSLv3
ssl.PROTOCOL_TLS Selects the highest protocol version that both the client and server support. Despite the name, this option can select both “SSL” and “TLS” protocols. New in version 3.6.
python.library.ssl#ssl.PROTOCOL_TLS
ssl.PROTOCOL_TLSv1 Selects TLS version 1.0 as the channel encryption protocol. Deprecated since version 3.6: OpenSSL has deprecated all version specific protocols. Use the default protocol PROTOCOL_TLS with flags like OP_NO_SSLv3 instead.
python.library.ssl#ssl.PROTOCOL_TLSv1
ssl.PROTOCOL_TLSv1_1 Selects TLS version 1.1 as the channel encryption protocol. Available only with openssl version 1.0.1+. New in version 3.4. Deprecated since version 3.6: OpenSSL has deprecated all version specific protocols. Use the default protocol PROTOCOL_TLS with flags like OP_NO_SSLv3 instead.
python.library.ssl#ssl.PROTOCOL_TLSv1_1
ssl.PROTOCOL_TLSv1_2 Selects TLS version 1.2 as the channel encryption protocol. This is the most modern version, and probably the best choice for maximum protection, if both sides can speak it. Available only with openssl version 1.0.1+. New in version 3.4. Deprecated since version 3.6: OpenSSL has deprecated all...
python.library.ssl#ssl.PROTOCOL_TLSv1_2
ssl.PROTOCOL_TLS_CLIENT Auto-negotiate the highest protocol version like PROTOCOL_TLS, but only support client-side SSLSocket connections. The protocol enables CERT_REQUIRED and check_hostname by default. New in version 3.6.
python.library.ssl#ssl.PROTOCOL_TLS_CLIENT
ssl.PROTOCOL_TLS_SERVER Auto-negotiate the highest protocol version like PROTOCOL_TLS, but only support server-side SSLSocket connections. New in version 3.6.
python.library.ssl#ssl.PROTOCOL_TLS_SERVER
Purpose.CLIENT_AUTH Option for create_default_context() and SSLContext.load_default_certs(). This value indicates that the context may be used to authenticate Web clients (therefore, it will be used to create server-side sockets). New in version 3.4.
python.library.ssl#ssl.Purpose.CLIENT_AUTH
Purpose.SERVER_AUTH Option for create_default_context() and SSLContext.load_default_certs(). This value indicates that the context may be used to authenticate Web servers (therefore, it will be used to create client-side sockets). New in version 3.4.
python.library.ssl#ssl.Purpose.SERVER_AUTH
ssl.RAND_add(bytes, entropy) Mix the given bytes into the SSL pseudo-random number generator. The parameter entropy (a float) is a lower bound on the entropy contained in string (so you can always use 0.0). See RFC 1750 for more information on sources of entropy. Changed in version 3.5: Writable bytes-like object is...
python.library.ssl#ssl.RAND_add
ssl.RAND_bytes(num) Return num cryptographically strong pseudo-random bytes. Raises an SSLError if the PRNG has not been seeded with enough data or if the operation is not supported by the current RAND method. RAND_status() can be used to check the status of the PRNG and RAND_add() can be used to seed the PRNG. For a...
python.library.ssl#ssl.RAND_bytes
ssl.RAND_egd(path) If you are running an entropy-gathering daemon (EGD) somewhere, and path is the pathname of a socket connection open to it, this will read 256 bytes of randomness from the socket, and add it to the SSL pseudo-random number generator to increase the security of generated secret keys. This is typical...
python.library.ssl#ssl.RAND_egd
ssl.RAND_pseudo_bytes(num) Return (bytes, is_cryptographic): bytes are num pseudo-random bytes, is_cryptographic is True if the bytes generated are cryptographically strong. Raises an SSLError if the operation is not supported by the current RAND method. Generated pseudo-random byte sequences will be unique if they a...
python.library.ssl#ssl.RAND_pseudo_bytes
ssl.RAND_status() Return True if the SSL pseudo-random number generator has been seeded with ‘enough’ randomness, and False otherwise. You can use ssl.RAND_egd() and ssl.RAND_add() to increase the randomness of the pseudo-random number generator.
python.library.ssl#ssl.RAND_status
exception ssl.SSLCertVerificationError A subclass of SSLError raised when certificate validation has failed. New in version 3.7. verify_code A numeric error number that denotes the verification error. verify_message A human readable string of the verification error.
python.library.ssl#ssl.SSLCertVerificationError
verify_code A numeric error number that denotes the verification error.
python.library.ssl#ssl.SSLCertVerificationError.verify_code
verify_message A human readable string of the verification error.
python.library.ssl#ssl.SSLCertVerificationError.verify_message
class ssl.SSLContext(protocol=PROTOCOL_TLS) Create a new SSL context. You may pass protocol which must be one of the PROTOCOL_* constants defined in this module. The parameter specifies which version of the SSL protocol to use. Typically, the server chooses a particular protocol version, and the client must adapt to ...
python.library.ssl#ssl.SSLContext
SSLContext.cert_store_stats() Get statistics about quantities of loaded X.509 certificates, count of X.509 certificates flagged as CA certificates and certificate revocation lists as dictionary. Example for a context with one CA cert and one other cert: >>> context.cert_store_stats() {'crl': 0, 'x509_ca': 1, 'x509': ...
python.library.ssl#ssl.SSLContext.cert_store_stats
SSLContext.check_hostname Whether to match the peer cert’s hostname in SSLSocket.do_handshake(). The context’s verify_mode must be set to CERT_OPTIONAL or CERT_REQUIRED, and you must pass server_hostname to wrap_socket() in order to match the hostname. Enabling hostname checking automatically sets verify_mode from CE...
python.library.ssl#ssl.SSLContext.check_hostname
SSLContext.get_ca_certs(binary_form=False) Get a list of loaded “certification authority” (CA) certificates. If the binary_form parameter is False each list entry is a dict like the output of SSLSocket.getpeercert(). Otherwise the method returns a list of DER-encoded certificates. The returned list does not contain c...
python.library.ssl#ssl.SSLContext.get_ca_certs
SSLContext.get_ciphers() Get a list of enabled ciphers. The list is in order of cipher priority. See SSLContext.set_ciphers(). Example: >>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) >>> ctx.set_ciphers('ECDHE+AESGCM:!ECDSA') >>> ctx.get_ciphers() # OpenSSL 1.0.x [{'alg_bits': 256, 'description': 'ECDHE-RSA-AES256-...
python.library.ssl#ssl.SSLContext.get_ciphers
SSLContext.hostname_checks_common_name Whether check_hostname falls back to verify the cert’s subject common name in the absence of a subject alternative name extension (default: true). Note Only writeable with OpenSSL 1.1.0 or higher. New in version 3.7. Changed in version 3.9.3: The flag had no effect with Ope...
python.library.ssl#ssl.SSLContext.hostname_checks_common_name
SSLContext.keylog_filename Write TLS keys to a keylog file, whenever key material is generated or received. The keylog file is designed for debugging purposes only. The file format is specified by NSS and used by many traffic analyzers such as Wireshark. The log file is opened in append-only mode. Writes are synchron...
python.library.ssl#ssl.SSLContext.keylog_filename
SSLContext.load_cert_chain(certfile, keyfile=None, password=None) Load a private key and the corresponding certificate. The certfile string must be the path to a single file in PEM format containing the certificate as well as any number of CA certificates needed to establish the certificate’s authenticity. The keyfil...
python.library.ssl#ssl.SSLContext.load_cert_chain
SSLContext.load_default_certs(purpose=Purpose.SERVER_AUTH) Load a set of default “certification authority” (CA) certificates from default locations. On Windows it loads CA certs from the CA and ROOT system stores. On other systems it calls SSLContext.set_default_verify_paths(). In the future the method may load CA ce...
python.library.ssl#ssl.SSLContext.load_default_certs
SSLContext.load_dh_params(dhfile) Load the key generation parameters for Diffie-Hellman (DH) key exchange. Using DH key exchange improves forward secrecy at the expense of computational resources (both on the server and on the client). The dhfile parameter should be the path to a file containing DH parameters in PEM ...
python.library.ssl#ssl.SSLContext.load_dh_params
SSLContext.load_verify_locations(cafile=None, capath=None, cadata=None) Load a set of “certification authority” (CA) certificates used to validate other peers’ certificates when verify_mode is other than CERT_NONE. At least one of cafile or capath must be specified. This method can also load certification revocation ...
python.library.ssl#ssl.SSLContext.load_verify_locations
SSLContext.maximum_version A TLSVersion enum member representing the highest supported TLS version. The value defaults to TLSVersion.MAXIMUM_SUPPORTED. The attribute is read-only for protocols other than PROTOCOL_TLS, PROTOCOL_TLS_CLIENT, and PROTOCOL_TLS_SERVER. The attributes maximum_version, minimum_version and SS...
python.library.ssl#ssl.SSLContext.maximum_version
SSLContext.minimum_version Like SSLContext.maximum_version except it is the lowest supported version or TLSVersion.MINIMUM_SUPPORTED. Note This attribute is not available unless the ssl module is compiled with OpenSSL 1.1.0g or newer. New in version 3.7.
python.library.ssl#ssl.SSLContext.minimum_version
SSLContext.num_tickets Control the number of TLS 1.3 session tickets of a TLS_PROTOCOL_SERVER context. The setting has no impact on TLS 1.0 to 1.2 connections. Note This attribute is not available unless the ssl module is compiled with OpenSSL 1.1.1 or newer. New in version 3.8.
python.library.ssl#ssl.SSLContext.num_tickets
SSLContext.options An integer representing the set of SSL options enabled on this context. The default value is OP_ALL, but you can specify other options such as OP_NO_SSLv2 by ORing them together. Note With versions of OpenSSL older than 0.9.8m, it is only possible to set options, not to clear them. Attempting to c...
python.library.ssl#ssl.SSLContext.options
SSLContext.post_handshake_auth Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is disabled by default and a server can only request a TLS client certificate during the initial handshake. When enabled, a server may request a TLS client certificate at any time after the handshake. When enabled ...
python.library.ssl#ssl.SSLContext.post_handshake_auth
SSLContext.protocol The protocol version chosen when constructing the context. This attribute is read-only.
python.library.ssl#ssl.SSLContext.protocol
SSLContext.session_stats() Get statistics about the SSL sessions created or managed by this context. A dictionary is returned which maps the names of each piece of information to their numeric values. For example, here is the total number of hits and misses in the session cache since the context was created: >>> stat...
python.library.ssl#ssl.SSLContext.session_stats
SSLContext.set_alpn_protocols(protocols) Specify which protocols the socket should advertise during the SSL/TLS handshake. It should be a list of ASCII strings, like ['http/1.1', 'spdy/2'], ordered by preference. The selection of a protocol will happen during the handshake, and will play out according to RFC 7301. Af...
python.library.ssl#ssl.SSLContext.set_alpn_protocols
SSLContext.set_ciphers(ciphers) Set the available ciphers for sockets created with this context. It should be a string in the OpenSSL cipher list format. If no cipher can be selected (because compile-time options or other configuration forbids use of all the specified ciphers), an SSLError will be raised. Note when ...
python.library.ssl#ssl.SSLContext.set_ciphers
SSLContext.set_default_verify_paths() Load a set of default “certification authority” (CA) certificates from a filesystem path defined when building the OpenSSL library. Unfortunately, there’s no easy way to know whether this method succeeds: no error is returned if no certificates are to be found. When the OpenSSL l...
python.library.ssl#ssl.SSLContext.set_default_verify_paths
SSLContext.set_ecdh_curve(curve_name) Set the curve name for Elliptic Curve-based Diffie-Hellman (ECDH) key exchange. ECDH is significantly faster than regular DH while arguably as secure. The curve_name parameter should be a string describing a well-known elliptic curve, for example prime256v1 for a widely supported...
python.library.ssl#ssl.SSLContext.set_ecdh_curve
SSLContext.set_npn_protocols(protocols) Specify which protocols the socket should advertise during the SSL/TLS handshake. It should be a list of strings, like ['http/1.1', 'spdy/2'], ordered by preference. The selection of a protocol will happen during the handshake, and will play out according to the Application Lay...
python.library.ssl#ssl.SSLContext.set_npn_protocols
SSLContext.set_servername_callback(server_name_callback) This is a legacy API retained for backwards compatibility. When possible, you should use sni_callback instead. The given server_name_callback is similar to sni_callback, except that when the server hostname is an IDN-encoded internationalized domain name, the s...
python.library.ssl#ssl.SSLContext.set_servername_callback
SSLContext.sni_callback Register a callback function that will be called after the TLS Client Hello handshake message has been received by the SSL/TLS server when the TLS client specifies a server name indication. The server name indication mechanism is specified in RFC 6066 section 3 - Server Name Indication. Only o...
python.library.ssl#ssl.SSLContext.sni_callback
SSLContext.sslobject_class The return type of SSLContext.wrap_bio(), defaults to SSLObject. The attribute can be overridden on instance of class in order to return a custom subclass of SSLObject. New in version 3.7.
python.library.ssl#ssl.SSLContext.sslobject_class
SSLContext.sslsocket_class The return type of SSLContext.wrap_socket(), defaults to SSLSocket. The attribute can be overridden on instance of class in order to return a custom subclass of SSLSocket. New in version 3.7.
python.library.ssl#ssl.SSLContext.sslsocket_class
SSLContext.verify_flags The flags for certificate verification operations. You can set flags like VERIFY_CRL_CHECK_LEAF by ORing them together. By default OpenSSL does neither require nor verify certificate revocation lists (CRLs). Available only with openssl version 0.9.8+. New in version 3.4. Changed in version ...
python.library.ssl#ssl.SSLContext.verify_flags
SSLContext.verify_mode Whether to try to verify other peers’ certificates and how to behave if verification fails. This attribute must be one of CERT_NONE, CERT_OPTIONAL or CERT_REQUIRED. Changed in version 3.6: SSLContext.verify_mode returns VerifyMode enum: >>> ssl.create_default_context().verify_mode <VerifyMode....
python.library.ssl#ssl.SSLContext.verify_mode
SSLContext.wrap_bio(incoming, outgoing, server_side=False, server_hostname=None, session=None) Wrap the BIO objects incoming and outgoing and return an instance of SSLContext.sslobject_class (default SSLObject). The SSL routines will read input data from the incoming BIO and write data to the outgoing BIO. The server...
python.library.ssl#ssl.SSLContext.wrap_bio
SSLContext.wrap_socket(sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, server_hostname=None, session=None) Wrap an existing Python socket sock and return an instance of SSLContext.sslsocket_class (default SSLSocket). The returned SSL socket is tied to the context, its settings and ce...
python.library.ssl#ssl.SSLContext.wrap_socket
exception ssl.SSLEOFError A subclass of SSLError raised when the SSL connection has been terminated abruptly. Generally, you shouldn’t try to reuse the underlying transport when this error is encountered. New in version 3.3.
python.library.ssl#ssl.SSLEOFError
exception ssl.SSLError Raised to signal an error from the underlying SSL implementation (currently provided by the OpenSSL library). This signifies some problem in the higher-level encryption and authentication layer that’s superimposed on the underlying network connection. This error is a subtype of OSError. The err...
python.library.ssl#ssl.SSLError
library A string mnemonic designating the OpenSSL submodule in which the error occurred, such as SSL, PEM or X509. The range of possible values depends on the OpenSSL version. New in version 3.3.
python.library.ssl#ssl.SSLError.library
reason A string mnemonic designating the reason this error occurred, for example CERTIFICATE_VERIFY_FAILED. The range of possible values depends on the OpenSSL version. New in version 3.3.
python.library.ssl#ssl.SSLError.reason
class ssl.SSLErrorNumber enum.IntEnum collection of SSL_ERROR_* constants. New in version 3.6.
python.library.ssl#ssl.SSLErrorNumber
class ssl.SSLObject A reduced-scope variant of SSLSocket representing an SSL protocol instance that does not contain any network IO methods. This class is typically used by framework authors that want to implement asynchronous IO for SSL through memory buffers. This class implements an interface on top of a low-level...
python.library.ssl#ssl.SSLObject
class ssl.SSLSession Session object used by session. id time timeout ticket_lifetime_hint has_ticket
python.library.ssl#ssl.SSLSession
has_ticket
python.library.ssl#ssl.SSLSession.has_ticket
id
python.library.ssl#ssl.SSLSession.id
ticket_lifetime_hint
python.library.ssl#ssl.SSLSession.ticket_lifetime_hint
time
python.library.ssl#ssl.SSLSession.time
timeout
python.library.ssl#ssl.SSLSession.timeout
class ssl.SSLSocket(socket.socket) SSL sockets provide the following methods of Socket Objects: accept() bind() close() connect() detach() fileno() getpeername(), getsockname() getsockopt(), setsockopt() gettimeout(), settimeout(), setblocking() listen() makefile() recv(), recv_into() (but passing a non-zero ...
python.library.ssl#ssl.SSLSocket
SSLSocket.cipher() Returns a three-value tuple containing the name of the cipher being used, the version of the SSL protocol that defines its use, and the number of secret bits being used. If no connection has been established, returns None.
python.library.ssl#ssl.SSLSocket.cipher
SSLSocket.compression() Return the compression algorithm being used as a string, or None if the connection isn’t compressed. If the higher-level protocol supports its own compression mechanism, you can use OP_NO_COMPRESSION to disable SSL-level compression. New in version 3.3.
python.library.ssl#ssl.SSLSocket.compression