diff --git a/src/Network/GemServ.hs b/src/Network/GemServ.hs index 12e81a0..64b7263 100644 --- a/src/Network/GemServ.hs +++ b/src/Network/GemServ.hs @@ -197,12 +197,13 @@ adjustServerParams certRef params = let hooks = serverHooks params certHook = onClientCertificate hooks - certHook' chain = case chain of - CertificateChain [] -> certHook chain - CertificateChain (se:_) -> do - let cert = signedObject $ getSigned se - writeIORef certRef (Just cert) - certHook chain + certHook' chain = do + case chain of + CertificateChain [] -> return () + CertificateChain (se:_) -> do + let cert = signedObject $ getSigned se + writeIORef certRef (Just cert) + certHook chain hooks' = hooks { onClientCertificate = certHook' } in params { serverHooks = hooks' }