test-certs-0.1.0.0: create temporary SSL certificates in tests
Copyright(c) 2023 Tim Emiola
LicenseBSD3
MaintainerTim Emiola <adetokunbo@emio.la>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Certs.Temp

Description

Enables configuration and generation of temporary certificates

Synopsis

generate certificates

withCertPaths :: FilePath -> Config -> (CertPaths -> IO a) -> IO a Source #

Create certificates in a temporary directory below parentDir, specify the locations using CertPaths, use them, then delete them

withCertFilenames :: (FilePath -> CertPaths) -> FilePath -> Config -> (CertPaths -> IO a) -> IO a Source #

Like withCertPaths, but allows the CertPath filenames to be specified

withCertPathsInTmp :: Config -> (CertPaths -> IO a) -> IO a Source #

Like withCertPaths with the system TEMP dir as the parentDir

withCertPathsInTmp' :: (CertPaths -> IO a) -> IO a Source #

Like withCertPathsInTmp using a default Config

generateAndStore :: CertPaths -> Config -> IO () Source #

Generate and store certificate files as specified as CertPaths

configuration

data Config Source #

Configure some details of the generated certificates

Constructors

Config 

Fields

Instances

Instances details
Show Config Source # 
Instance details

Defined in Test.Certs.Temp

Eq Config Source # 
Instance details

Defined in Test.Certs.Temp

defaultConfig :: Config Source #

A default value for Config: CN=localhost, duration is 365 days.

certificate filenames

data CertPaths Source #

Specifies the location to write the temporary certificates

Constructors

CertPaths 

Fields

Instances

Instances details
Show CertPaths Source # 
Instance details

Defined in Test.Certs.Temp

Eq CertPaths Source # 
Instance details

Defined in Test.Certs.Temp

keyPath :: CertPaths -> FilePath Source #

The path of the generated key file

certificatePath :: CertPaths -> FilePath Source #

The path of the generated certificate file