on master help sign in
updating doc.
commitdd16920f65066bf73efb91bd8a106a5d8cabfc84 authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 21 Jul 2015, 16:44 (11 years ago) parente80fd0c
1 file changed+18−9
warp-tls/Network/Wai/Handler/WarpTLS.hs+18−9
warp-tls/Network/Wai/Handler/WarpTLS.hs+18−9
@@ -15,20 +15,22 @@
1515module Network.Wai.Handler.WarpTLS (
1616 -- * Settings
1717 TLSSettings
18+ , defaultTlsSettings
19+ -- * Accessors
1820 , certFile
1921 , keyFile
20− , onInsecure
2122 , tlsLogging
2223 , tlsAllowedVersions
2324 , tlsCiphers
2425 , tlsWantClientCert
2526 , tlsServerHooks
26− , defaultTlsSettings
27+ , onInsecure
28+ , OnInsecure (..)
29+ -- * Smart constructors
2730 , tlsSettings
2831 , tlsSettingsMemory
2932 , tlsSettingsChain
3033 , tlsSettingsChainMemory
31− , OnInsecure (..)
3234 -- * Runner
3335 , runTLS
3436 , runTLSSocket
@@ -59,6 +61,7 @@ import System.IO.Error (isEOFError)
5961
6062----------------------------------------------------------------
6163
64+-- | Settings for WarpTLS.
6265data TLSSettings = TLSSettings {
6366 certFile :: FilePath
6467 -- ^ File containing the certificate.
@@ -70,8 +73,10 @@ data TLSSettings = TLSSettings {
7073 , chainCertsMemory :: [S.ByteString]
7174 , keyMemory :: Maybe S.ByteString
7275 , onInsecure :: OnInsecure
73− -- ^ Do we allow insecure connections with this server as well? Default
74− -- is a simple text response stating that a secure connection is required.
76+ -- ^ Do we allow insecure connections with this server as well?
77+ --
78+ -- >>> onInsecure defaultTlsSettings
79+ -- DenyInsecure "This server only accepts secure HTTPS connections."
7580 --
7681 -- Since 1.4.0
7782 , tlsLogging :: TLS.Logging
@@ -83,13 +88,15 @@ data TLSSettings = TLSSettings {
8388 , tlsAllowedVersions :: [TLS.Version]
8489 -- ^ The TLS versions this server accepts.
8590 --
86− -- Default: '[TLS.TLS10,TLS.TLS11,TLS.TLS12]'.
91+ -- >>> tlsAllowedVersions defaultTlsSettings
92+ -- [TLS12,TLS11,TLS10]
8793 --
8894 -- Since 1.4.2
8995 , tlsCiphers :: [TLS.Cipher]
9096 -- ^ The TLS ciphers this server accepts.
9197 --
92− -- Default: '[TLSExtra.cipher_AES128_SHA1, TLSExtra.cipher_AES256_SHA1, TLSEtra.cipher_RC4_128_MD5, TLSExtra.cipher_RC4_128_SHA1]'
98+ -- >>> tlsCiphers defaultTlsSettings
99+ -- [ECDHE-RSA-AES128GCM-SHA256,DHE-RSA-AES128GCM-SHA256,DHE-RSA-AES256-SHA256,DHE-RSA-AES128-SHA256,DHE-RSA-AES256-SHA1,DHE-RSA-AES128-SHA1,DHE-DSA-AES128-SHA1,DHE-DSA-AES256-SHA1,DHE-DSA-RC4-SHA1,RSA-aes128-sha1,RSA-aes256-sha1,RSA-rc4-128-md5,RSA-rc4-128-sha1]
93100 --
94101 -- Since 1.4.2
95102 , tlsWantClientCert :: Bool
@@ -97,7 +104,8 @@ data TLSSettings = TLSSettings {
97104 -- is set to True, you must handle received certificates in a server hook
98105 -- or all connections will fail.
99106 --
100− -- Default: False
107+ -- >>> tlsWantClientCert defaultTlsSettings
108+ -- False
101109 --
102110 -- Since 3.0.2
103111 , tlsServerHooks :: TLS.ServerHooks
@@ -110,7 +118,7 @@ data TLSSettings = TLSSettings {
110118 -- Since 3.0.2
111119 }
112120
113−-- | Default 'TLSSettings'. Use this to create 'TLSSettings' with the field record name.
121+-- | Default 'TLSSettings'. Use this to create 'TLSSettings' with the field record name (aka accessors).
114122defaultTlsSettings :: TLSSettings
115123defaultTlsSettings = TLSSettings {
116124 certFile = "certificate.pem"
@@ -150,6 +158,7 @@ ciphers =
150158-- | An action when a plain HTTP comes to HTTP over TLS/SSL port.
151159data OnInsecure = DenyInsecure L.ByteString
152160 | AllowInsecure
161+ deriving (Show)
153162
154163----------------------------------------------------------------
155164