on master help sign in
more docs.
commitc2f60ba93ec8136dbee77c8907099d05d9e21aa8 authorKazu Yamamoto <kazu@iij.ad.jp> dateTue 21 May 2013, 18:24 (13 years ago) parent1598615
1 file changed+6
warp-tls/Network/Wai/Handler/WarpTLS.hs+6
warp-tls/Network/Wai/Handler/WarpTLS.hs+6
@@ -65,9 +65,11 @@ data TLSSettings = TLSSettings
6565 -- Since 1.4.0
6666 }
6767
68+-- | An action when a plain HTTP comes to HTTP over TLS/SSL port.
6869data OnInsecure = DenyInsecure L.ByteString
6970 | AllowInsecure
7071
72+-- | A smart constructor for 'TLSSettings'.
7173tlsSettings :: FilePath -- ^ Certificate file
7274 -> FilePath -- ^ Key file
7375 -> TLSSettings
@@ -76,6 +78,7 @@ tlsSettings cert key = defaultTlsSettings
7678 , keyFile = key
7779 }
7880
81+-- | Default 'TLSSettings'. Use this to create 'TLSSettings' with the field record name.
7982defaultTlsSettings :: TLSSettings
8083defaultTlsSettings = TLSSettings
8184 { certFile = "certificate.pem"
@@ -84,6 +87,8 @@ defaultTlsSettings = TLSSettings
8487 , tlsLogging = TLS.defaultLogging
8588 }
8689
90+-- | Running 'Application' with 'TLSSettings' and 'Settings' using
91+-- specified 'Socket'.
8792runTLSSocket :: TLSSettings -> Settings -> Socket -> Application -> IO ()
8893runTLSSocket TLSSettings {..} set sock app = do
8994 certs <- readCertificates certFile
@@ -155,6 +160,7 @@ data WarpTLSException = InsecureConnectionDenied
155160 deriving (Show, Typeable)
156161instance Exception WarpTLSException
157162
163+-- | Running 'Application' with 'TLSSettings' and 'Settings'.
158164runTLS :: TLSSettings -> Settings -> Application -> IO ()
159165runTLS tset set app =
160166 bracket