Importing a SSL certificate using the keytool utility results in an Illegal Header error
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
Problem
Attempting to import a new certificate into your local keystore using the keytool utility results in an error:
keytool error: java.security.cert.CertificateException: java.io.IOException: Illegal header: -----BEGIN CERTIFICATE-----
Cause
This error is generally caused by a white space character in the header of the certificate. See this Stackflow discussion for more details.
Resolution
Locate and remove any whitespace from the header of the certificate. See this discussion for tips on how this can be accomplished.