Importing a SSL certificate using the keytool utility results in an Illegal Header error

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

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.

Last modified on Mar 31, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.