Summary
Error
Cause
This error indicates there was an issue connecting to Mobile Center i.e. Eclipse cannot find the required CA Certificate in the loaded jre keystore to allow connection to the Mobile Center server.
Fix
Ensure that the required certificate has been generated to allow access to your Mobile Center server.
More information can be found in the link below:
https://admhelp.microfocus.com/mobilecenter/en/3.1/Content/SSL.htm?Highlight=ss
After you have successfully generated the required certificate follow the steps below to locate the trust store that you’re respective JDK is loading:
-
Create a new Run Configuration in Eclipse
- Go to Run > Run Configurations
-
Inside the arguments tab add the following VM argument:
- -Djavax.net.debug=all
- On executing the test again, debug information regarding the Java networking will be output
-
The top of the output should indicate the trust store location
-
This will confirm the location of the cacerts your JVM is loading
- e.g “trustStore is: C:\Program Files\Java\jdk<version>\jre\lib\security\cacerts”
-
This will confirm the location of the cacerts your JVM is loading
***************************CONSOLE OUTPUT*****************************************
Inaccessible trust store: C:\Program Files\Java\jre1.8.0_221\lib\security\jssecacerts
trustStore is: C:\Program Files\Java\jre1.8.0_221\lib\security\cacerts
trustStore type is: jks
trustStore provider is:
the last modified time is: Fri Aug 30 23:17:38 BST 2019
***************************CONSOLE OUTPUT*****************************************
After indicating the required location of the trust store,
- Open command prompt as administrator
-
Type the following commands
- Cd C:\Program Files\Java\jdk<version>\jre<Version>\bin
-
keytool -importcert -trustcacerts -file <Cert file location>\certificate.crt -keystore "<JRE location from above>\lib\security\cacerts" -storepass "changeit"
- (this will import the certificate from the specified file location into the keystore cacerts)
- Test script in eclipse should now be able to connect to Mobile Center
After completing the steps above, you should now be able to connect to Mobile Center via Appium Server.