2

Here is how I try to make HTTPS Post request in android

String server ="https://myserver.com:4343/api";
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost(server);

List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("property", value));
request.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8"));

client.execute(request);

Now I have an error "No peer certificate", though certificate is correct and I can access server from browser with GET request.

I've tried different ways of doing POST request, tried to not specify schema or port in server string. No luck. What am I doing wrong?

Vitalii Korsakov
  • 45,737
  • 20
  • 72
  • 90

0 Answers0