on master help sign in
adding defaultTlsSettings.
0f7f362Kazu Yamamoto
warp-tls/Network/Wai/Handler/WarpTLS.hs+7−1
@@ -12,6 +12,7 @@ module Network.Wai.Handler.WarpTLS
12 , onInsecure
12 , onInsecure
13 , tlsLogging
13 , tlsLogging
14 , OnInsecure (..)
14 , OnInsecure (..)
15+ , defaultTlsSettings
15 , tlsSettings
16 , tlsSettings
16 , runTLS
17 , runTLS
17 , runTLSSocket
18 , runTLSSocket
@@ -67,9 +68,14 @@ data OnInsecure = DenyInsecure L.ByteString
67tlsSettings :: FilePath -- ^ Certificate file
68tlsSettings :: FilePath -- ^ Certificate file
68 -> FilePath -- ^ key file
69 -> FilePath -- ^ key file
69 -> TLSSettings
70 -> TLSSettings
70−tlsSettings cert key = TLSSettings
71+tlsSettings cert key = defaultTlsSettings
71 { certFile = cert
72 { certFile = cert
72 , keyFile = key
73 , keyFile = key
74+ }
75+
76+defaultTlsSettings = TLSSettings
77+ { certFile = "certificate.pem"
78+ , keyFile = "key.pem"
73 , onInsecure = DenyInsecure "This server only accepts secure HTTPS connections."
79 , onInsecure = DenyInsecure "This server only accepts secure HTTPS connections."
74 , tlsLogging = TLS.defaultLogging
80 , tlsLogging = TLS.defaultLogging
75 }
81 }