I have an android app that connects to HelioHost. My app runs fine on the emulator (API 33) but when I run it on a real device (API 22) I get the following exception:
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Here is the code that produces the exception:
protected String doInBackground(String... strings) {
String username = strings[0];
String activationKey = strings[1];
InputStream inStream = null;
String response = null;
try {
ContentValues values=new ContentValues();
values.put("username", username);
values.put("activationKey", activationKey);
URL url = new URL("https://zelda82.heliohost.org/activation.php");
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setDoInput(true);
conn.setDoOutput(true);
OutputStream os = conn.getOutputStream();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8"));
writer.write(getQuery(values));
writer.flush();
writer.close();
os.close();
BufferedReader reader = new BufferedReader(new InputStreamReader((conn.getInputStream())));
response = reader.readLine();
reader.close();
}
catch(Exception e) {
e.printStackTrace();
}
return response;
}
I didn’t have this problem before them doing a maintenance. Is it possible that there is a server misconfiguration?
zeldafan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.