on master help sign in
Allow warp-tls to request client certificates.
commit52b953c5ad9e767596d141b37fa61dc179e2bb61 authorClint Adams <clint@debian.org> dateSun 15 Feb 2015, 13:22 (12 years ago) parent0ffb30e
1 file changed+4−1
warp-tls/Network/Wai/Handler/WarpTLS.hs+4−1
warp-tls/Network/Wai/Handler/WarpTLS.hs+4−1
@@ -15,6 +15,7 @@ module Network.Wai.Handler.WarpTLS (
1515 , tlsLogging
1616 , tlsAllowedVersions
1717 , tlsCiphers
18+ , tlsWantClientCert
1819 , defaultTlsSettings
1920 , tlsSettings
2021 , tlsSettingsMemory
@@ -81,6 +82,7 @@ data TLSSettings = TLSSettings {
8182 -- Default: '[TLSExtra.cipher_AES128_SHA1, TLSExtra.cipher_AES256_SHA1, TLSEtra.cipher_RC4_128_MD5, TLSExtra.cipher_RC4_128_SHA1]'
8283 --
8384 -- Since 1.4.2
85+ , tlsWantClientCert :: Bool
8486 }
8587
8688-- | Default 'TLSSettings'. Use this to create 'TLSSettings' with the field record name.
@@ -94,6 +96,7 @@ defaultTlsSettings = TLSSettings {
9496 , tlsLogging = def
9597 , tlsAllowedVersions = [TLS.TLS10,TLS.TLS11,TLS.TLS12]
9698 , tlsCiphers = ciphers
99+ , tlsWantClientCert = False
97100 }
98101
99102-- taken from stunnel example in tls-extra
@@ -175,7 +178,7 @@ runTLSSocket' tlsset@TLSSettings{..} set credential sock app =
175178 where
176179 get = getter tlsset sock params
177180 params = def {
178− TLS.serverWantClientCert = False
181+ TLS.serverWantClientCert = tlsWantClientCert
179182 , TLS.serverSupported = def {
180183 TLS.supportedVersions = tlsAllowedVersions
181184 , TLS.supportedCiphers = tlsCiphers