X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=examples%2FSSL.hs;h=aa8b3a596ffa29031eb136d5b7587976c4ac3f0e;hp=624ed042647729a3003849c4106d7ef293fc63b1;hb=fffa09842d060c7d738084125dea07783d84aefe;hpb=060378af59e17e67e3cf79fc35f6e95ff770b9ef diff --git a/examples/SSL.hs b/examples/SSL.hs index 624ed04..aa8b3a5 100644 --- a/examples/SSL.hs +++ b/examples/SSL.hs @@ -42,17 +42,16 @@ main = withOpenSSL $ helloWorld ∷ Resource helloWorld - = C.fromList - [ ( GET - , do setContentType [mimeType| text/plain |] - putChunk "getRemoteCertificate = " - cert ← do cert ← getRemoteCertificate - case cert of - Just c → liftIO $ Lazy.pack <$> printX509 c - Nothing → return "Nothing" - putChunks cert - ) - ] + = C.singleton + ( GET + , do setContentType [mimeType| text/plain |] + putChunk "getRemoteCertificate = " + cert ← do cert ← getRemoteCertificate + case cert of + Just c → liftIO $ Lazy.pack <$> printX509 c + Nothing → return "Nothing" + putChunks cert + ) genCert ∷ KeyPair k ⇒ k → IO X509 genCert pkey