Skip to content

Commit

Permalink
Merge pull request haskell-tls#488 from kazu-yamamoto/exporting-defaults
Browse files Browse the repository at this point in the history
exporting defaults
  • Loading branch information
kazu-yamamoto authored Nov 3, 2024
2 parents 5211e00 + 70eb905 commit bb4aaff
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
10 changes: 9 additions & 1 deletion tls/Network/TLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module Network.TLS (

-- ** Server parameters
ServerParams,
defaultParamsServer,
serverWantClientCert,
serverCACertificates,
serverDHEParams,
Expand All @@ -67,6 +68,7 @@ module Network.TLS (

-- ** Shared
Shared,
defaultShared,
sharedCredentials,
sharedSessionManager,
sharedCAStore,
Expand All @@ -75,6 +77,7 @@ module Network.TLS (

-- ** Client hooks
ClientHooks,
defaultClientHooks,
OnCertificateRequest,
onCertificateRequest,
OnServerCertificate,
Expand All @@ -85,6 +88,7 @@ module Network.TLS (

-- ** Server hooks
ServerHooks,
defaultServerHooks,
onClientCertificate,
onUnverifiedClientCert,
onCipherChoosing,
Expand All @@ -99,6 +103,7 @@ module Network.TLS (

-- ** Supported
Supported,
defaultSupported,
supportedVersions,
supportedCiphers,
supportedCompressions,
Expand All @@ -113,6 +118,7 @@ module Network.TLS (

-- ** Debug parameters
DebugParams,
defaultDebugParams,
debugSeed,
debugPrintSeed,
debugVersionForced,
Expand Down Expand Up @@ -231,6 +237,7 @@ module Network.TLS (

-- ** Modifying hooks in context
Hooks,
defaultHooks,
hookRecvHandshake,
hookRecvHandshake13,
hookRecvCertificates,
Expand All @@ -242,6 +249,7 @@ module Network.TLS (
contextHookSetHandshake13Recv,
contextHookSetCertificateRecv,
Logging,
defaultLogging,
loggingPacketSent,
loggingPacketRecv,
loggingIOSent,
Expand Down Expand Up @@ -324,7 +332,7 @@ import Network.TLS.X509

import Data.ByteString as B
import Data.X509 (PrivKey (..), PubKey (..))
import Data.X509.Validation hiding (HostName)
import Data.X509.Validation hiding (HostName, defaultHooks)

{-# DEPRECATED Bytes "Use Data.ByteString.Bytestring instead of Bytes." #-}
type Bytes = B.ByteString
Expand Down
1 change: 1 addition & 0 deletions tls/Network/TLS/Hooks.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Network.TLS.Hooks (
Logging (..),
defaultLogging,
Hooks (..),
defaultHooks,
) where
Expand Down
29 changes: 18 additions & 11 deletions tls/Network/TLS/Parameters.hs
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
module Network.TLS.Parameters (
ClientParams (..),
defaultParamsClient,
ServerParams (..),
defaultParamsServer,
CommonParams,
DebugParams (..),
defaultDebugParams,
ClientHooks (..),
defaultClientHooks,
OnCertificateRequest,
OnServerCertificate,
ServerHooks (..),
defaultServerHooks,
Supported (..),
defaultSupported,
Shared (..),

-- * special default
defaultParamsClient,
defaultShared,

-- * Parameters
MaxFragmentEnum (..),
Expand Down Expand Up @@ -409,14 +413,17 @@ data Shared = Shared
instance Show Shared where
show _ = "Shared"
instance Default Shared where
def =
Shared
{ sharedCredentials = mempty
, sharedSessionManager = noSessionManager
, sharedCAStore = mempty
, sharedValidationCache = def
, sharedHelloExtensions = []
}
def = defaultShared

defaultShared :: Shared
defaultShared =
Shared
{ sharedCredentials = mempty
, sharedSessionManager = noSessionManager
, sharedCAStore = mempty
, sharedValidationCache = def
, sharedHelloExtensions = []
}

-- | Group usage callback possible return values.
data GroupUsage
Expand Down
2 changes: 1 addition & 1 deletion tls/Network/TLS/QUIC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import Network.TLS.Handshake.State
import Network.TLS.Handshake.State13
import Network.TLS.Imports
import Network.TLS.KeySchedule (hkdfExpandLabel, hkdfExtract)
import Network.TLS.Parameters
import Network.TLS.Parameters hiding (defaultSupported)
import Network.TLS.Record.Layer
import Network.TLS.Record.State
import Network.TLS.Struct
Expand Down

0 comments on commit bb4aaff

Please sign in to comment.