Код: Выделить всё
javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Код: Выделить всё
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;
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... -a-real-de