Skip to content

Commit

Permalink
Accommodate tls-2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Oct 23, 2024
1 parent 6b7f1e4 commit a4e295b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Keter/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ reverseProxy listener = do
settings <- ask
let (run, isSecure) =
case listener of
LPInsecure host port ->
LPInsecure host port ->
(liftIO . Warp.runSettings (warp host port), False)
LPSecure host port cert chainCerts key session ->
LPSecure host port cert chainCerts key session ->
(liftIO . WarpTLS.runTLS
(connectClientCertificates (psHostLookup settings) session $ WarpTLS.tlsSettingsChain
cert
Expand All @@ -150,7 +150,7 @@ reverseProxy listener = do
connectClientCertificates :: (ByteString -> IO (Maybe (ProxyAction, TLS.Credentials))) -> Bool -> WarpTLS.TLSSettings -> WarpTLS.TLSSettings
connectClientCertificates hl session s =
let
newHooks@TLS.ServerHooks{..} = WarpTLS.tlsServerHooks s
newHooks = WarpTLS.tlsServerHooks s
-- todo: add nested lookup
newOnServerNameIndication (Just n) =
maybe mempty snd <$> hl (S8.pack n)
Expand Down Expand Up @@ -179,7 +179,7 @@ withClient isSecure = do
} psManager
where
logException :: Wai.Request -> SomeException -> KeterM ProxySettings ()
logException a b = logErrorN $ pack $
logException a b = logErrorN $ pack $
"Got a proxy exception on request " <> show a <> " with exception " <> show b


Expand Down

0 comments on commit a4e295b

Please sign in to comment.