Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exposing getClientCertificateChain. #407

Merged
merged 2 commits into from
Dec 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions core/Network/TLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ module Network.TLS
, unClientRandom
, unServerRandom
, HandshakeMode13(..)
, getClientCertificateChain
-- ** Negotiated
, getNegotiatedProtocol
, getClientSNI
Expand Down Expand Up @@ -170,6 +171,7 @@ 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(..)
Expand All @@ -186,3 +188,11 @@ import Data.X509.Validation hiding (HostName)

{-# DEPRECATED Bytes "Use Data.ByteString.Bytestring instead of Bytes." #-}
type Bytes = B.ByteString

-- | Getting certificates from a client, if any.
-- Note that the certificates are not sent by a client
-- on resumption even if client authentication is required.
-- So, this API would be replaced by the one which can treat
-- both cases of full-negotiation and resumption.
getClientCertificateChain :: Context -> IO (Maybe CertificateChain)
getClientCertificateChain ctx = usingState_ ctx S.getClientCertificateChain