Created
September 26, 2012 08:42
-
-
Save jhartikainen/3786838 to your computer and use it in GitHub Desktop.
Segfault on Ubuntu 12.04 GHC 7.4.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE BangPatterns #-} | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Lazy as L | |
import Data.PEM (PEM(..), pemParseBS) | |
import Data.Certificate.X509 | |
import Data.Either | |
main :: IO () | |
main = do | |
certdata <- B.readFile "7d0b38bd.0" | |
let certPem = pemParseBS certdata | |
case certPem of | |
Right pem -> do | |
-- decodeCertificate will segfault on Ubuntu 12.04 / GHC 7.4.1 | |
let !c = decodeCertificate $ L.fromChunks [pemContent (pem !! 0)] | |
putStrLn "read all certs" | |
_ -> error "nothing" | |
return () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can find the required certificate file on Ubuntu in
/etc/ssl/certs
, or at the following URL: http://jjh.fi/~jani/7d0b38bd.0