haskell-tls / hs-certificate

Certificate and Key Reader/Writer in haskell
60 stars 57 forks source link

readKeyFile fails on certain keys #41

Closed hansler closed 9 years ago

hansler commented 9 years ago

If I generate a key using:

openssl genrsa -out key.pem 2048

Then readKeyFile succeeds as expected:

Prelude Data.X509.File> readKeyFile "key.pem"
[PrivKeyRSA (PrivateKey ... )]

However, if I generate a key using:

openssl req -new -newkey rsa:2048 -nodes -keyout key.pem -out key.csr

Then it fails:

Prelude Data.X509.File> readKeyFile "key.pem"
[]

They should both be 2048 bit RSA keys, so I'm not sure why this happens. (I discovered this while trying to get https to work with keter).

wereHamster commented 9 years ago

Can't reproduce (using code from commit 4101e9e (bump version to 1.5.1, 2015-05-30)). Can you attach the key file to this issue?

hansler commented 9 years ago

It seems to have been fixed -- I can't reproduce it anymore either.