When running command keytool on the AdminUI to insert a signed
certificate for SSL accesses, then the keytool command reports an
error.
PS C:\Program Files\CA\siteminder\adminui\standalone\configuration>
keytool -importcert -alias jboss_key -file myCert.p7b -keystore keyStore.jks -storepass changeit -v
and the command report error :
keytool error: java.security.cert.CertificateException: java.io.IOException: Incomplete data
at sun.security.provider.X509Factory.engineGenerateCertificates(X509Factory.java:358)
Caused by: java.io.IOException: Incomplete data
There's a BOM problem with the file itself, which makes it
unreadable :
# file myCert.p7b
myCert.p7b: UTF-8 Unicode (with BOM) text, with CRLF line terminators
You can remove the BOM that way from a Linux box :
# tail -c +4 myCert.p7b > myCert-nobom.p7b
and then the file is now recognized as a certificate format :
# file myCert-nobom.p7b
myCert-nobom.p7b: PEM certificate
Remove the BOM :
# tail -c +4 myCert.p7b > myCert-nobom.p7b
and import the certificates in the TrustedStore.
Restart the AdminUI;
Verify that the AdminUI present the expected signed certificate with
that command from Linux box :
# openssl s_client -connect AdminUI_IP_Address:port -crlf