1.先生成p12文件,生成的時候需要指定密碼
openssl pkcs12 -export -in your_crt.crt -inkey your_key.key -out your_p12.p12
2.再生成keystore文件
keytool -importkeystore -v -srckeystore your_p12.p12 -srcstoretype pkcs12 -srcstorepass 你設置的密碼 -destkeystore your_keystore.keystore -deststoretype jks -deststorepass 你設置的密碼
3.然后就能使用這個keystore文件和密碼來進行https的請求
參考
https://blog.csdn.net/u013944791/article/details/73551253
其他證書轉換參考
http://www.netkiller.cn/cryptography/openssl/format.html