导入CA证书报错:
keytool error: java.lang.Exception: Input not an X.509 certificate
如果你的CA证书是如下格式的:
-----BEGIN CERTIFICATE-----
MIIFODCCBCCgAwIBAgIQU
yjELMAkGA1UEBhMCVVM
ExZWZXJpU2lnbiBUcnVz
U2lnbiwgSW5jLiAtIEZv
ZXJpU2lnbiBDbGFz
......
-----END CERTIFICATE-----
修改格式:保证除了begin、end,都在一行内
-----BEGIN CERTIFICATE-----
MIIFODCCBCCgAwIBAgIQUyjELMAkGA1UEBhMCVVMExZWZXJpU2lnbiBUcnVzU2lnbiwgSW5jLiAtIEZvZXJpU2lnbiBDbGFz......
-----END CERTIFICATE-----
修改格式后导入成功:
Certificate was added to keystore