我想在我的android应用程序中从moodle(比如我们大学的moodle网站)获得身份验证。而且我无权访问数据库。我尝试使用用户名和密码从我的应用程序发出 http 发布请求。
但是当我执行发布请求时,我得到了一个例外。这是我尝试过的
private URI url = new URI("https://online.mrt.ac.lk/login/index.php");
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("username", "user"));
nameValuePairs.add(new BasicNameValuePair("password", "password"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
我得到这样的例外
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
请有人帮助我。