Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accommodate tls-2.1.0 #297

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading