Started getting this error today after renewing my fake CA cert im using to test out an app. No it wasn't the new lines, the problem was a missing '-' character at the end of the last line.
This is what happens when you just copy and paste the cert
This is what happens when you just copy and paste the cert