packages feed

quic 0.3.3 → 0.3.4

raw patch · 7 files changed

+43/−3 lines, 7 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Network.QUIC.Internal: [scWantClientCert] :: ServerConfig -> Bool
+ Network.QUIC.Server: scWantClientCert :: ServerConfig -> Bool
- Network.QUIC.Internal: ServerConfig :: [Version] -> [Cipher] -> [Group] -> [[Group]] -> Parameters -> (String -> IO ()) -> Maybe FilePath -> Credentials -> Hooks -> ServerHooks -> Bool -> Int -> [(IP, PortNumber)] -> Maybe (Version -> [ByteString] -> IO ByteString) -> Bool -> SessionManager -> Maybe FilePath -> Int -> ServerConfig
+ Network.QUIC.Internal: ServerConfig :: [Version] -> [Cipher] -> [Group] -> [[Group]] -> Parameters -> (String -> IO ()) -> Maybe FilePath -> Credentials -> Hooks -> ServerHooks -> Bool -> Int -> [(IP, PortNumber)] -> Maybe (Version -> [ByteString] -> IO ByteString) -> Bool -> Bool -> SessionManager -> Maybe FilePath -> Int -> ServerConfig

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # ChangeLog +## 0.3.4++* Add a server option to request client certificates.+  [#94](https://github.com/kazu-yamamoto/quic/pull/94)+ ## 0.3.3  * RST_STREAM now contains a proper final size.
Network/QUIC/Config.hs view
@@ -196,6 +196,8 @@     -- ^ Server addresses assigned to used network interfaces.     , scALPN :: Maybe (Version -> [ByteString] -> IO ByteString)     -- ^ ALPN handler.+    , scWantClientCert :: Bool+    -- ^ Request a certificate from clients.     , scRequireRetry :: Bool     -- ^ Requiring QUIC retry.     , scSessionManager :: SessionManager@@ -228,6 +230,7 @@         , -- server original           scAddresses = [("0.0.0.0", 4433), ("::", 4433)]         , scALPN = Nothing+        , scWantClientCert = False         , scRequireRetry = False         , scSessionManager = noSessionManager         , scDebugLog = Nothing
Network/QUIC/Server.hs view
@@ -10,6 +10,7 @@     defaultServerConfig,     scAddresses,     scALPN,+    scWantClientCert,     scRequireRetry,     scUse0RTT,     scMaxDatagramFrameSize,
Network/QUIC/TLS.hs view
@@ -92,7 +92,8 @@   where     sparams =         defaultParamsServer-            { serverShared = sshared+            { serverWantClientCert = scWantClientCert+            , serverShared = sshared             , serverHooks = hook             , serverSupported = supported             , serverDebug = debug
quic.cabal view
@@ -1,6 +1,6 @@-cabal-version:      >=1.10+cabal-version:      2.0 name:               quic-version:            0.3.3+version:            0.3.4 license:            BSD3 license-file:       LICENSE maintainer:         kazu@iij.ad.jp
test/HandshakeSpec.hs view
@@ -36,6 +36,27 @@             let cc = testClientConfig                 sc = sc0             testHandshake cc sc waitS FullHandshake+        it "can request and accept a client certificate" $ do+            let TLS.Credentials credentials = scCredentials sc0+            credential <- case credentials of+                [] -> expectationFailure "test server has no credentials" >> fail "missing credentials"+                cred : _ -> pure cred+            let clientHooks =+                    (ccTlsHooks testClientConfig)+                        { TLS.onCertificateRequest = const (pure (Just credential))+                        }+                serverHooks =+                    (scTlsHooks sc0)+                        { TLS.onClientCertificate = const (pure TLS.CertificateUsageAccept)+                        , TLS.onUnverifiedClientCert = pure True+                        }+                cc = testClientConfig{ccTlsHooks = clientHooks}+                sc =+                    sc0+                        { scWantClientCert = True+                        , scTlsHooks = serverHooks+                        }+            testHandshake cc sc waitS FullHandshake         it "can handshake in the case of TLS hello retry" $ do             let cc = testClientConfig                 sc = sc0{scGroups = [P256], scGroupsTLS13 = [[P256]]}
test/TLSSpec.hs view
@@ -25,6 +25,15 @@  spec :: Spec spec = do+    describe "server configuration" $ do+        it "does not request client certificates by default" $+            scWantClientCert defaultServerConfig `shouldBe` False++        it "allows client certificates to be requested" $+            scWantClientCert+                defaultServerConfig{scWantClientCert = True}+                `shouldBe` True+     ----------------------------------------------------------------     -- RFC 9001     --