Nginx SSL PEM_read_bio End of Line Error

We had this ssl cert issued by Network Solutions

 1root@www:/etc/nginx/conf.d/ssl/example-2020# unzip -l EXAMPLE.ORG.zip
 2Archive:  EXAMPLE.ORG.zip
 3  Length      Date    Time    Name
 4---------  ---------- -----   ----
 5     2150  2020-07-14 16:59   DV_NetworkSolutionsDVServerCA2.crt
 6Network Solutions DV Intermediate CA
 7     2093  2020-07-14 16:59   DV_USERTrustRSACertificationAuthority.crt
 8Network Solutions DV Intermediate CA 2
 9     2174  2020-07-14 16:59   EXAMPLE.ORG.crt
10Domain certificate
11---------                     -------
12     6417                     3 files

I created a bundle as this was for Nginx cat EXAMPLE.ORG.crt DV_NetworkSolutionsDVServerCA2.crt DV_USERTrustRSACertificationAuthority.crt > www.example.org-bundle.crt

When I tried verifying, I got this error:

1root@www:/etc/nginx/sites-available# openssl crl2pkcs7 -nocrl -certfile /etc/nginx/conf.d/ssl/example-2020/www.example.org-bundle.crt | openssl pkcs7 -print_certs -noout
2error reading the file, /etc/nginx/conf.d/ssl/example-2020/www.example.org-bundle.crt
3error loading certificates
4140490570237584:error:0906D066:PEM routines:PEM_read_bio:bad end line:pem_lib.c:804:
5unable to load PKCS7 object
6140226013042320:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: PKCS7

I fixed it by using a now defunct site's blog whiched fortunately was still accessible using archive.org. https://web.archive.org/web/20130329092455/http://danalloway.com/nginx-ssl-pem_read_biobad-end-line-error/

It basically says that the line-ending was problematic. So all I need to do was do manual correction on the output file "www.example.org-bundle.crt" and it's fixed.

Kudos to https://www.endpoint.com/blog/2013/02/05/network-solutions-nginx-ssl-certificate-installation