Connectrix-Brocade B-series: Certificate servercert.pem: Is an unknown x509 format
Summary: The seccermgmt cert shows error "Is an unknown x509 format."
Symptoms
fc-switch:user> seccertmgmt show -cert https Certificate servercert.pem: Is an unknown x509 format.
Ensured that the below details were verified:
- There should be the BEGIN CERTIFICATE and END CERTIFICATE attributes that surround the Base 64 ASCII contents.
- For the CA Certificate which is usually a chained certificate, it would contain the same format, but the order is important. It should be for example:
Intermediate CA 1
Intermediate CA 2
Intermediate CA 3
Root CA
Cause
The occurrence of the "Bad Format Certificate" could be if the certificate is a Windows formatted in text file, where when viewed in a UNIX/Linux environment display "^M" at the end of each line.
This conversion introduces additional characters, particularly the "^M" character or additional space after the "-----END CERTIFICATE-----" delimiter.
Resolution
To address this issue, it is imperative to ensure that there are no extra spaces or characters following the "-----END CERTIFICATE-----" delimiter within the certificate.
Here is how to recover from this situation and convert the file from Microsoft format to UNIX/Linux format using the "vi" text editor:
- First, create a backup copy of the .pem file to preserve the original data.
- Open the .pem file using the "vi" text editor. This can be accomplished by entering the following command in the terminal.
Run the vi command::setlocal ff=unix
Then run the vi command::wq
The .pem file now has the "^M" or extra space removed from all lines in the file.
At this point, you can now attempt to reimport the modified .pem file, and the "Bad Format Certificate" error should be resolved.
Additional Information