{-# LANGUAGE CPP #-}
module Network.TLS
(
Context
, contextNew
, handshake
, sendData
, recvData
, bye
, HasBackend(..)
, Backend(..)
, TLSParams
, ClientParams(..)
, defaultParamsClient
, ServerParams(..)
, Shared(..)
, ClientHooks(..)
, OnCertificateRequest
, OnServerCertificate
, ServerHooks(..)
, Measurement(..)
, Supported(..)
, DebugParams(..)
, Credentials(..)
, Credential
, credentialLoadX509
, credentialLoadX509FromMemory
, credentialLoadX509Chain
, credentialLoadX509ChainFromMemory
, SessionManager(..)
, noSessionManager
, SessionID
, SessionData(..)
, SessionFlag(..)
, TLS13TicketInfo
, ValidationCache(..)
, ValidationCacheQueryCallback
, ValidationCacheAddCallback
, ValidationCacheResult(..)
, exceptionValidationCache
, Version(..)
, Compression(..)
, nullCompression
, HashAndSignatureAlgorithm
, HashAlgorithm(..)
, SignatureAlgorithm(..)
, Group(..)
, EMSMode(..)
, DHParams
, DHPublic
, GroupUsage(..)
, CertificateUsage(..)
, CertificateRejectReason(..)
, CertificateType(..)
, HostName
, MaxFragmentEnum(..)
, ctxConnection
, contextFlush
, contextClose
, Information(..)
, contextGetInformation
, ClientRandom
, ServerRandom
, unClientRandom
, unServerRandom
, HandshakeMode13(..)
, getClientCertificateChain
, getNegotiatedProtocol
, getClientSNI
, updateKey
, KeyUpdateRequest(..)
, requestCertificate
, getFinished
, getPeerFinished
, Hooks(..)
, contextModifyHooks
, Handshake
, contextHookSetHandshakeRecv
, Handshake13
, contextHookSetHandshake13Recv
, contextHookSetCertificateRecv
, Logging(..)
, Header(..)
, ProtocolType(..)
, contextHookSetLogging
, TLSError(..)
, KxError(..)
, AlertDescription(..)
, TLSException(..)
, CompressionC(..)
, CompressionID
, PubKey(..)
, PrivKey(..)
, module Network.TLS.Cipher
, recvData'
, contextNewOnHandle
#ifdef INCLUDE_NETWORK
, contextNewOnSocket
#endif
, Bytes
, ValidationChecks(..)
, ValidationHooks(..)
) where
import Network.TLS.Backend (Backend(..), HasBackend(..))
import Network.TLS.Cipher
import Network.TLS.Compression (CompressionC(..), Compression(..), nullCompression)
import Network.TLS.Context
import Network.TLS.Core
import Network.TLS.Credentials
import Network.TLS.Crypto (KxError(..), DHParams, DHPublic, Group(..))
import Network.TLS.Handshake.State (HandshakeMode13(..))
import Network.TLS.Hooks
import Network.TLS.Measurement
import Network.TLS.Parameters
import Network.TLS.Session
import qualified Network.TLS.State as S
import Network.TLS.Struct ( TLSError(..), TLSException(..)
, HashAndSignatureAlgorithm, HashAlgorithm(..), SignatureAlgorithm(..)
, Header(..), ProtocolType(..), CertificateType(..)
, AlertDescription(..)
, ClientRandom(..), ServerRandom(..)
, Handshake)
import Network.TLS.Struct13 ( Handshake13 )
import Network.TLS.Types
import Network.TLS.X509
import Data.ByteString as B
import Data.X509 (PubKey(..), PrivKey(..))
import Data.X509.Validation hiding (HostName)
{-# DEPRECATED Bytes "Use Data.ByteString.Bytestring instead of Bytes." #-}
type Bytes = B.ByteString
getClientCertificateChain :: Context -> IO (Maybe CertificateChain)
getClientCertificateChain :: Context -> IO (Maybe CertificateChain)
getClientCertificateChain Context
ctx = forall a. Context -> TLSSt a -> IO a
usingState_ Context
ctx TLSSt (Maybe CertificateChain)
S.getClientCertificateChain