OpenSSL tool will print out details about certificate file. If the file is corrupted (for example it contains additional whitespace characters) it will tell you in which part of the file is a problem. For example SSL certificate file contains whitespace character in Private Key section - OpenSSL will return error message:
unable to load Private Key
1318:error:0906B06B:PEM routines:PEM_get_EVP_CIPHER_INFO:not proc type:pem_lib.c:441: