add parameters for session resuming
mostly callbacks during the handshake, and a parameter to enable session usage.
This commit is contained in:
parent
34b186b852
commit
83b860726d
1 changed files with 10 additions and 0 deletions
|
@ -74,10 +74,15 @@ data TLSParams = TLSParams
|
|||
, pWantClientCert :: Bool -- ^ request a certificate from client.
|
||||
-- use by server only.
|
||||
, pUseSecureRenegotiation :: Bool -- notify that we want to use secure renegotation
|
||||
, pUseSession :: Bool -- generate new session if specified
|
||||
, pCertificates :: [(X509, Maybe PrivateKey)] -- ^ the cert chain for this context with the associated keys if any.
|
||||
, pLogging :: TLSLogging -- ^ callback for logging
|
||||
, onHandshake :: Measurement -> IO Bool -- ^ callback on a beggining of handshake
|
||||
, onCertificatesRecv :: [X509] -> IO TLSCertificateUsage -- ^ callback to verify received cert chain.
|
||||
, onSessionResumption :: SessionID -> IO (Maybe SessionData) -- ^ callback to maybe resume session on server.
|
||||
, onSessionEstablished :: SessionID -> SessionData -> IO () -- ^ callback when session have been established
|
||||
, onSessionInvalidated :: SessionID -> IO () -- ^ callback when session is invalidated by error
|
||||
, sessionResumeWith :: Maybe (SessionID, SessionData) -- ^ try to establish a connection using this session.
|
||||
}
|
||||
|
||||
defaultLogging :: TLSLogging
|
||||
|
@ -96,10 +101,15 @@ defaultParams = TLSParams
|
|||
, pCompressions = [nullCompression]
|
||||
, pWantClientCert = False
|
||||
, pUseSecureRenegotiation = True
|
||||
, pUseSession = True
|
||||
, pCertificates = []
|
||||
, pLogging = defaultLogging
|
||||
, onHandshake = (\_ -> return True)
|
||||
, onCertificatesRecv = (\_ -> return CertificateUsageAccept)
|
||||
, onSessionResumption = (\_ -> return Nothing)
|
||||
, onSessionEstablished = (\_ _ -> return ())
|
||||
, onSessionInvalidated = (\_ -> return ())
|
||||
, sessionResumeWith = Nothing
|
||||
}
|
||||
|
||||
instance Show TLSParams where
|
||||
|
|
Loading…
Reference in a new issue