diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 293e4484..428f556f 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.17.20230925 +# version: 0.17.20231110 # -# REGENDATA ("0.17.20230925",["github","cabal.project.ci"]) +# REGENDATA ("0.17.20231110",["github","cabal.project.ci"]) # name: Haskell-CI on: @@ -28,14 +28,14 @@ jobs: strategy: matrix: include: - - compiler: ghc-9.6.2 + - compiler: ghc-9.6.3 compilerKind: ghc - compilerVersion: 9.6.2 + compilerVersion: 9.6.3 setup-method: ghcup allow-failure: false - - compiler: ghc-9.4.5 + - compiler: ghc-9.4.8 compilerKind: ghc - compilerVersion: 9.4.5 + compilerVersion: 9.4.8 setup-method: ghcup allow-failure: false - compiler: ghc-9.2.8 @@ -58,7 +58,7 @@ jobs: curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -76,7 +76,7 @@ jobs: echo "HC=$HC" >> "$GITHUB_ENV" echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV" HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" @@ -160,11 +160,6 @@ jobs: echo "package grapesy" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <= 0.5 && < 0.6 , hashable >= 1.3 && < 1.5 , http-types >= 0.12 && < 0.13 + , http2 >= 5.0 && < 5.1 + , http2-tls >= 0.2 && < 0.3 , mtl >= 2.2 && < 2.4 , network >= 3.1 && < 3.2 , network-byte-order >= 0.1 && < 0.2 @@ -167,16 +169,12 @@ library , utf8-string >= 1.0 && < 1.1 , zlib >= 0.6 && < 0.7 - -- We need an unreleased version of http2 right now - , http2 - , http2-tls - -- tls 1.7 starts using Kazu's forked versions of x509-* packages if flag(crypton) -- Lower bounds are the first version of these packages after forking. -- Upper bounds as discussed above. build-depends: - , tls >= 1.7 && < 1.8 + , tls >= 1.7 && < 1.10 , crypton-x509 >= 1.7 && < 1.8 , crypton-x509-store >= 1.6 && < 1.7 , crypton-x509-system >= 1.6 && < 1.7 @@ -227,7 +225,7 @@ test-suite test-grapesy , contra-tracer >= 0.2 && < 0.3 , data-default >= 0.7 && < 0.8 , exceptions >= 0.10 && < 0.11 - , http2 + , http2 >= 5.0 && < 5.1 , mtl >= 2.2 && < 2.4 , pretty-show >= 1.10 && < 1.11 , QuickCheck >= 2.14 && < 2.15 @@ -236,7 +234,7 @@ test-suite test-grapesy , tasty-hunit >= 0.10 && < 0.11 , tasty-quickcheck >= 0.10 && < 0.11 , text >= 1.2 && < 2.1 - , tls >= 1.5 && < 1.8 + , tls >= 1.5 && < 1.10 executable demo-client import: @@ -353,12 +351,12 @@ executable test-stress , containers >= 0.6 && < 0.7 , contra-tracer >= 0.2 && < 0.3 , data-default >= 0.7 && < 0.8 - , http2 + , http2 >= 5.0 && < 5.1 , optparse-applicative >= 0.16 && < 0.19 , pretty-show >= 1.10 && < 1.11 , stm >= 2.5 && < 2.6 , text >= 1.2 && < 2.1 - , tls >= 1.5 && < 1.8 + , tls >= 1.5 && < 1.10 if !flag(build-stress-test) buildable: diff --git a/src/Network/GRPC/Client/Connection.hs b/src/Network/GRPC/Client/Connection.hs index 90031f73..8ada3dd3 100644 --- a/src/Network/GRPC/Client/Connection.hs +++ b/src/Network/GRPC/Client/Connection.hs @@ -400,7 +400,7 @@ stayConnected connParams server connVar connCanClose = HTTP2.Client.run (clientConfig auth Http) conf - $ \sendRequest -> do + $ \sendRequest _aux -> do traceWith tracer $ ClientDebugConnectedInsecure let conn = Session.ConnectionToServer sendRequest atomically $ writeTVar connVar $ ConnectionReady connClosed conn @@ -423,7 +423,7 @@ stayConnected connParams server connVar connCanClose = settings (authorityHost auth) (fromIntegral $ authorityPort auth) - $ \sendRequest -> do + $ \sendRequest _aux -> do traceWith tracer $ ClientDebugConnectedSecure let conn = Session.ConnectionToServer sendRequest atomically $ writeTVar connVar $ ConnectionReady connClosed conn @@ -470,14 +470,9 @@ stayConnected connParams server connVar connCanClose = -- TODO: This is currently only used for the HTTP case, not HTTPS clientConfig :: Authority -> Scheme -> HTTP2.Client.ClientConfig - clientConfig auth scheme = HTTP2.Client.ClientConfig { - scheme = rawScheme serverPseudoHeaders - , authority = rawAuthority serverPseudoHeaders - - -- Docs describe this as "How many pushed responses are contained in - -- the cache". Since gRPC does not make use of HTTP2 server push, we - -- set it to 0. - , cacheLimit = 0 + clientConfig auth scheme = HTTP2.Client.defaultClientConfig { + HTTP2.Client.scheme = rawScheme serverPseudoHeaders + , HTTP2.Client.authority = rawAuthority serverPseudoHeaders } where serverPseudoHeaders :: RawServerHeaders diff --git a/src/Network/GRPC/Server/Run.hs b/src/Network/GRPC/Server/Run.hs index 9ef4d78d..3c613f9a 100644 --- a/src/Network/GRPC/Server/Run.hs +++ b/src/Network/GRPC/Server/Run.hs @@ -107,7 +107,7 @@ runInsecure ServerSetup{serverHandlerHook} server cfg = runTCPServer (insecureHost cfg) (insecurePort cfg) $ \sock -> do bracket (HTTP2.allocSimpleConfig sock writeBufferSize) HTTP2.freeSimpleConfig $ \config -> - HTTP2.run config $ serverHandlerHook server + HTTP2.run HTTP2.defaultServerConfig config $ serverHandlerHook server {------------------------------------------------------------------------------- Secure (over TLS) diff --git a/test-common/Test/Util/ClientServer.hs b/test-common/Test/Util/ClientServer.hs index 16fd2a8c..36fab0ce 100644 --- a/test-common/Test/Util/ClientServer.hs +++ b/test-common/Test/Util/ClientServer.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Test.Util.ClientServer ( @@ -175,6 +176,16 @@ isExpectedException cfg assessCustomException topLevel = | Just (tls :: TLSException) <- fromException err = case (useTLS cfg, tls) of +#if MIN_VERSION_tls(1,9,0) + ( Just (TlsFail TlsFailValidation) + , HandshakeFailed (Error_Protocol _msg UnknownCa) + ) -> + Right $ ExpectedExceptionTls tls + ( Just (TlsFail TlsFailHostname) + , HandshakeFailed (Error_Protocol _msg CertificateUnknown) + ) -> + Right $ ExpectedExceptionTls tls +#else ( Just (TlsFail TlsFailValidation) , HandshakeFailed (Error_Protocol (_msg, _bool, UnknownCa)) ) -> @@ -183,6 +194,7 @@ isExpectedException cfg assessCustomException topLevel = , HandshakeFailed (Error_Protocol (_msg, _bool, CertificateUnknown)) ) -> Right $ ExpectedExceptionTls tls +#endif ( Just (TlsFail TlsFailUnsupported) , HandshakeFailed (Error_Packet_Parsing _) ) ->