    {-# OPTIONS_HADDOCK not-home #-}
    module Data.Conduit.Network.TLS.Internal
        ( TLSConfig (..)
        , TlsCertData (..)
        ) where

    import Prelude hiding (FilePath)
    import Data.Streaming.Network (HostPreference)
    import qualified Data.ByteString as S

    -- structure providing access to certificate and key data through call backs
    data TlsCertData = TlsCertData { TlsCertData -> IO ByteString
    getTLSCert :: IO S.ByteString
                                   , TlsCertData -> IO [ByteString]
    getTLSChainCerts :: IO [S.ByteString]
                                   , TlsCertData -> IO ByteString
    getTLSKey :: IO S.ByteString }

    data TLSConfig = TLSConfig
        { TLSConfig -> HostPreference
    tlsHost :: HostPreference
        , TLSConfig -> Int
    tlsPort :: Int
        , TLSConfig -> TlsCertData
    tlsCertData :: TlsCertData
        , TLSConfig -> Bool
    tlsNeedLocalAddr :: Bool
        }