I have following android POST code. It works fine for http but fails for HTTPS with Not Trusted Server Certificate exception. I do not mind self signing or accepting all certificates code (drawback less secure with man-in-the-middle attack).
HttpPost post = new HttpPost("https://yourdomain.com/yourskript.xyz");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("postValue1", "my Value"));
nameValuePairs.add(new BasicNameValuePair("postValue2", "2nd Value"));
nameValuePairs.add(new BasicNameValuePair("postValue3", "3rd Value"));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpClient client = new DefaultHttpClient(); HttpResponse response =
client.execute(post); HttpEntity entity = response.getEntity();
String responseText = EntityUtils.toString(entity);
Any help appreciated here. I need the certificate portion of the code with submitting POST with postValue1, postValue2, and postValue3 (minimum 3).