Fix cert writing
Make csr test pass
Do not strip newlines from certificate