tests.tlstests.conftest

mTLS fixtures

Module Contents

Functions

datadir(nice_tmpdir_mod)

Make sure we have a well known directory structure

keypair(datadir)

Generate a keypair

csrfile(datadir, keypair)

Generate CSR file

mtlsfiles(csrfile)

Return cert, key and ca cert paths, this will sign the CSR again every time due to fixture scoping issues

mtlsclient(mtlsfiles)

fixture for client session with correct ssl context

Attributes

LOGGER

LOGGER[source]
datadir(nice_tmpdir_mod)[source]

Make sure we have a well known directory structure

Parameters:

nice_tmpdir_mod (str)

Return type:

pathlib.Path

keypair(datadir)[source]

Generate a keypair

Parameters:

datadir (pathlib.Path)

Return type:

OpenSSL.crypto.PKey

csrfile(datadir, keypair)[source]

Generate CSR file

Parameters:
Return type:

pathlib.Path

async mtlsfiles(csrfile)[source]

Return cert, key and ca cert paths, this will sign the CSR again every time due to fixture scoping issues

Parameters:

csrfile (pathlib.Path)

Return type:

Tuple[pathlib.Path, pathlib.Path]

mtlsclient(mtlsfiles)[source]

fixture for client session with correct ssl context

Parameters:

mtlsfiles (Tuple[pathlib.Path, pathlib.Path])

Return type:

aiohttp.ClientSession