Velleman / python-linkplay

LinkPlay library for Python
MIT License
9 stars 4 forks source link

Async mTLS file operation #32

Closed dukeofphilberg closed 3 months ago

dukeofphilberg commented 3 months ago

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.