Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Functions | Variables
pip._vendor.urllib3.contrib._securetransport.low_level Namespace Reference

Functions

 _cf_data_from_bytes (bytestring)
 
 _cf_dictionary_from_tuples (tuples)
 
 _cfstr (py_bstr)
 
 _create_cfstring_array (lst)
 
 _cf_string_to_unicode (value)
 
 _assert_no_error (error, exception_class=None)
 
 _cert_array_from_pem (pem_bundle)
 
 _is_cert (item)
 
 _is_identity (item)
 
 _temporary_keychain ()
 
 _load_items_from_file (keychain, path)
 
 _load_client_cert_chain (keychain, *paths)
 
 _build_tls_unknown_ca_alert (version)
 

Variables

 _PEM_CERTS_RE
 
dict TLS_PROTOCOL_VERSIONS
 

Detailed Description

Low-level helpers for the SecureTransport bindings.

These are Python functions that are not directly related to the high-level APIs
but are necessary to get them to work. They include a whole bunch of low-level
CoreFoundation messing about and memory management. The concerns in this module
are almost entirely about trying to avoid memory leaks and providing
appropriate and useful assistance to the higher-level code.

Function Documentation

◆ _assert_no_error()

pip._vendor.urllib3.contrib._securetransport.low_level._assert_no_error (   error,
  exception_class = None 
)
protected
Checks the return code and throws an exception if there is an error to
report

◆ _build_tls_unknown_ca_alert()

pip._vendor.urllib3.contrib._securetransport.low_level._build_tls_unknown_ca_alert (   version)
protected
Builds a TLS alert record for an unknown CA.

◆ _cert_array_from_pem()

pip._vendor.urllib3.contrib._securetransport.low_level._cert_array_from_pem (   pem_bundle)
protected
Given a bundle of certs in PEM format, turns them into a CFArray of certs
that can be used to validate a cert chain.

◆ _cf_data_from_bytes()

pip._vendor.urllib3.contrib._securetransport.low_level._cf_data_from_bytes (   bytestring)
protected
Given a bytestring, create a CFData object from it. This CFData object must
be CFReleased by the caller.

◆ _cf_dictionary_from_tuples()

pip._vendor.urllib3.contrib._securetransport.low_level._cf_dictionary_from_tuples (   tuples)
protected
Given a list of Python tuples, create an associated CFDictionary.

◆ _cf_string_to_unicode()

pip._vendor.urllib3.contrib._securetransport.low_level._cf_string_to_unicode (   value)
protected
Creates a Unicode string from a CFString object. Used entirely for error
reporting.

Yes, it annoys me quite a lot that this function is this complex.

◆ _cfstr()

pip._vendor.urllib3.contrib._securetransport.low_level._cfstr (   py_bstr)
protected
Given a Python binary data, create a CFString.
The string must be CFReleased by the caller.

◆ _create_cfstring_array()

pip._vendor.urllib3.contrib._securetransport.low_level._create_cfstring_array (   lst)
protected
Given a list of Python binary data, create an associated CFMutableArray.
The array must be CFReleased by the caller.

Raises an ssl.SSLError on failure.

◆ _is_cert()

pip._vendor.urllib3.contrib._securetransport.low_level._is_cert (   item)
protected
Returns True if a given CFTypeRef is a certificate.

◆ _is_identity()

pip._vendor.urllib3.contrib._securetransport.low_level._is_identity (   item)
protected
Returns True if a given CFTypeRef is an identity.

◆ _load_client_cert_chain()

pip._vendor.urllib3.contrib._securetransport.low_level._load_client_cert_chain (   keychain,
paths 
)
protected
Load certificates and maybe keys from a number of files. Has the end goal
of returning a CFArray containing one SecIdentityRef, and then zero or more
SecCertificateRef objects, suitable for use as a client certificate trust
chain.

◆ _load_items_from_file()

pip._vendor.urllib3.contrib._securetransport.low_level._load_items_from_file (   keychain,
  path 
)
protected
Given a single file, loads all the trust objects from it into arrays and
the keychain.
Returns a tuple of lists: the first list is a list of identities, the
second a list of certs.

◆ _temporary_keychain()

pip._vendor.urllib3.contrib._securetransport.low_level._temporary_keychain ( )
protected
This function creates a temporary Mac keychain that we can use to work with
credentials. This keychain uses a one-time password and a temporary file to
store the data. We expect to have one keychain per socket. The returned
SecKeychainRef must be freed by the caller, including calling
SecKeychainDelete.

Returns a tuple of the SecKeychainRef and the path to the temporary
directory that contains it.

Variable Documentation

◆ _PEM_CERTS_RE

pip._vendor.urllib3.contrib._securetransport.low_level._PEM_CERTS_RE
protected
Initial value:
1= re.compile(
2 b"-----BEGIN CERTIFICATE-----\n(.*?)\n-----END CERTIFICATE-----", re.DOTALL
3)

◆ TLS_PROTOCOL_VERSIONS

dict pip._vendor.urllib3.contrib._securetransport.low_level.TLS_PROTOCOL_VERSIONS
Initial value:
1= {
2 "SSLv2": (0, 2),
3 "SSLv3": (3, 0),
4 "TLSv1": (3, 1),
5 "TLSv1.1": (3, 2),
6 "TLSv1.2": (3, 3),
7}