It turns out it was two things that was causing this error. One was that I was using incorrect chain file and the reverse intermediate.pem was the correct certificate to use and second, when I converted the CER file into a PEM I used putty to convert it and the PEM files were encrypted...
The best way to convert a CER into a PEM is to just rename it on a text editor haha.