I am trying to do a https post but there are issues with the certificate on the server I am trying to access. So going by these instructions I need to add the certificate to a keystore.
The article suggests that I need to run the following command:
export CLASSPATH=bcprov-jdk16-145.jar
CERTSTORE=res/raw/mystore.bks
if [ -a $CERTSTORE ]; then
rm $CERTSTORE || exit 1
fi
keytool \
-import \
-v \
-trustcacerts \
-alias 0 \
-file <(openssl x509 -in mycert.pem) \
-keystore $CERTSTORE \
-storetype BKS \
-provider org.bouncycastle.jce.provider.BouncyCastleProvider \
-providerpath /usr/share/java/bcprov.jar \
-storepass some-password
Being new to Android Studio, I have no idea where this should be run. Can somebody please give me details instructions on how to add my certificate to a Keystore from within Android Studio?
EDIT: My platform is Windows. These seem to be commands for Unix? If so, how do I perform the same operations on Windows?