This PR implements two new functions to create the SSLContext (async_create_unverified_context) and ClientSession (async_create_unverified_client_session) asynchronously.
The cert chain file written for SSLContext is now written asynchronously as a tempfile with aiofiles. Loading the cert file with the load_cert_chain() function is still synchronous as there is no async variant.
The PR also splits off the SSLContext creation in create_ssl_context as it is duplicated for both async_create_unverified_context and create_unverified_context and optimizes it by creating it directly.
This PR implements two new functions to create the
SSLContext (async_create_unverified_context)
andClientSession (async_create_unverified_client_session)
asynchronously.The cert chain file written for
SSLContext
is now written asynchronously as a tempfile withaiofiles
. Loading the cert file with theload_cert_chain()
function is still synchronous as there is no async variant.The PR also splits off the
SSLContext
creation increate_ssl_context
as it is duplicated for bothasync_create_unverified_context
andcreate_unverified_context
and optimizes it by creating it directly.