vincenthz/hs-certificate — pull request #7 by larskuhtz (2012-05-07 01:47:55+00:00)
Title: Fix deadlock due to lazy IO in findCertificate for MacOS

Hi,

findCertificate hangs on my machine which is a MacOS X box. I think, that this is caused by the
call to waitForProcess after calling hGetContents of Data.ByteString.Lazy. The process
may only terminate when the std_out pipe is closed which will happen only after the result
of hGetContents is consumed. Due to lazy IO this won't happen before the call to
waitForProcess. Forcing strict evaluation of the resulting certificate before waitForProcess
is called fixed the issue for me.