From a4e295b91f32ec375e76351d4bcd6cbb604c81b7 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Wed, 23 Oct 2024 22:43:09 +0100 Subject: [PATCH] Accommodate tls-2.1.0 --- src/Keter/Proxy.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Keter/Proxy.hs b/src/Keter/Proxy.hs index 1750e01..cc39f88 100644 --- a/src/Keter/Proxy.hs +++ b/src/Keter/Proxy.hs @@ -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 @@ -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) @@ -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