Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Segfault on Ubuntu 12.04 GHC 7.4.1
{-# 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 ()
@jhartikainen
Copy link
Author

jhartikainen commented Sep 26, 2012

You can find the required certificate file on Ubuntu in /etc/ssl/certs, or at the following URL: http://jjh.fi/~jani/7d0b38bd.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment