1

I cant login to my code it always says Login Failed. Debug not showing me LOG.d also so i dont know where is my error. Please help thanks.

@Override
public void onClick(View v) {
    HashMap postData = new HashMap();
    String username = etUsername.getText().toString();
    String password = etPassword.getText().toString();
    postData.put("username",username);
    postData.put("password",password);

    PostResponseAsyncTask task1 = new PostResponseAsyncTask(MainActivity.this, postData, new AsyncResponse() {
        @Override
        public void processFinish(String s) {
            Log.d(LOG, s);
            if(s.contains("success")){
                Toast.makeText(MainActivity.this,"Login Success",Toast.LENGTH_LONG).show();
            }else{
                Toast.makeText(MainActivity.this,"Login Failed",Toast.LENGTH_LONG).show();
            }
        }
    });
    task1.execute("https://10.0.2.2/carkila/");
}
Jeyjey
  • 341
  • 1
  • 4
  • 10
  • You're gonna have a lot of trouble with self-signed SSL certificates and Java. You'll need to add the self-signed certificate to the java keystore – Mitch Talmadge Jul 09 '16 at 05:05
  • http://stackoverflow.com/questions/2893819/telling-java-to-accept-self-signed-ssl-certificate – Henning Luther Jul 09 '16 at 06:22
  • Post the stack trace. The fact that you know what the exception is contradicts most of the statements in your question. – user207421 Jul 09 '16 at 10:13

1 Answers1

0

Where do you see the exception? On the server side or the client side? If on the server side, then it's trying to authenticate the client certificate (and fails to do so). If the exception is shown on the client side, then the client fails to authenticate the server certificate.

Either way, if you do not intend to validate certificates here, then you have configuration issues. If you do intend to do so, check that the certificates are signed by accepted CAs.

Ravivm
  • 46
  • 2