First, convert your certificate in a DER format :
openssl x509 -outform der -in certificate.pem -out certificate.der
And after, import it in the keystore :
keytool -import -alias your-alias -keystore cacerts -file certificate.der
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…