From c30796dde00bc51ff429356186cf6369ad7d44e4 Mon Sep 17 00:00:00 2001 From: Romain GERARD Date: Sun, 12 Jul 2020 12:38:24 +0200 Subject: [PATCH] Add Support for TLS 1.3 Former-commit-id: a137a97a2eee198af224f649d9a583965d19d7d4 Former-commit-id: 9959e6c092824cb6cda2e1a34d998a051921f54d [formerly 21db0555fa62a1417c32e2643b3930fbfbf782b0] [formerly 2b3c3465fb9d6de01f47ff1452a28d177f89f69c [formerly b5a72adeed14fa5186f7ec79c99234823eb53f06 [formerly b5a72adeed14fa5186f7ec79c99234823eb53f06 [formerly b5a72adeed14fa5186f7ec79c99234823eb53f06 [formerly 237d793fffe4ce05b8a0dd2490a6132b3fcf132e]]]]] Former-commit-id: a6b5c1678673619a1f3a9cfcc226426e153b6596 [formerly 25a9a41fba724314423baa06e69eddec385bd29b] Former-commit-id: c4fa74f3f3ac613787b0379d7c85c8341666f9e6 Former-commit-id: 4d0ecb4badf6ade0f8db7f09c6a005ece7818f83 Former-commit-id: 361f8af56bef5f164ab0b5391097d891fb15c99c Former-commit-id: 19e1adbbec30af852428168ac7c1f6bce569e8ec [formerly bd6215392e7e581fe2c9efc8bfd4ed24c69368d7] Former-commit-id: 7d968b29d1e39c0d2b0a7ff4651bf2b6e87592a2 --- src/Types.hs | 10 ++++++---- stack.yaml | 2 +- wstunnel.cabal | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Types.hs b/src/Types.hs index f3007c7..777a271 100644 --- a/src/Types.hs +++ b/src/Types.hs @@ -13,8 +13,7 @@ import Data.ByteString (hGetSome, hPutStr) import qualified Data.Streaming.Network as N import qualified Network.Connection as NC -import Network.Socket (HostName, PortNumber(..)) -import Network.Socket.Internal (PortNumber(..)) +import Network.Socket (HostName, PortNumber) import qualified Network.Socket as N hiding (recv, recvFrom, send, sendTo) import qualified Network.Socket.ByteString as N @@ -22,11 +21,14 @@ import qualified Network.Socket.ByteString as N import qualified Network.WebSockets.Connection as WS import System.IO.Unsafe (unsafeDupablePerformIO) -deriving instance Generic PortNumber -deriving instance Hashable PortNumber + +instance Hashable PortNumber where + hashWithSalt s p = hashWithSalt s (fromEnum p) + deriving instance Generic N.SockAddr deriving instance Hashable N.SockAddr + {-# NOINLINE defaultRecvBufferSize #-} defaultRecvBufferSize :: Int defaultRecvBufferSize = unsafeDupablePerformIO $ diff --git a/stack.yaml b/stack.yaml index 69d1316..daa0633 100644 --- a/stack.yaml +++ b/stack.yaml @@ -15,7 +15,7 @@ # resolver: # name: custom-snapshot # location: "./custom-snapshot.yaml" -resolver: lts-14.11 +resolver: lts-16.4 # User packages to be built. # Various formats can be used as shown in the example below. diff --git a/wstunnel.cabal b/wstunnel.cabal index 7e9bbc5..2d18736 100644 --- a/wstunnel.cabal +++ b/wstunnel.cabal @@ -26,7 +26,7 @@ library , connection , hslogger , mtl - , network < 3.0.0.0 + , network , network-conduit-tls , streaming-commons , text >= 1.2.2.1 @@ -46,7 +46,7 @@ test-suite wstunnel-test , text >= 1.2.2.1 , classy-prelude , bytestring - , network < 3.0.0.0 + , network , network-conduit-tls , streaming-commons , wstunnel