hs-connection
hs-connection copied to clipboard
connectionInfo
Possibly add & export a function to Network.Connection that allows the user of the library to query information about an established TLS connection. Something along the lines of (using LambdaCase)
connectionInfo :: Connection -> IO (Maybe TLS.Information)
connectionInfo c = do
tryReadMVar (connectionBackend c) >>= \case
Nothing -> return Nothing
Just connBackend -> do
case connBackend of
ConnectionTLS ctx -> TLS.contextGetInformation ctx
_ -> return Nothing