wpadebug: Add option to ignore SSL errors
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
aa20e1a1fb
commit
56cb4e1788
1 changed files with 32 additions and 0 deletions
|
@ -9,11 +9,15 @@
|
||||||
package w1.fi.wpadebug;
|
package w1.fi.wpadebug;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
import android.net.http.SslError;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.webkit.SslErrorHandler;
|
||||||
import android.webkit.WebChromeClient;
|
import android.webkit.WebChromeClient;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
@ -110,5 +114,33 @@ public class WpaWebViewActivity extends Activity
|
||||||
description + " (URL=" + failingUrl + ")",
|
description + " (URL=" + failingUrl + ")",
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReceivedSslError(WebView view, SslErrorHandler handler,
|
||||||
|
SslError error)
|
||||||
|
{
|
||||||
|
Log.d(TAG, "SSL error: " + error);
|
||||||
|
|
||||||
|
final SslErrorHandler h = handler;
|
||||||
|
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
|
||||||
|
alert.setTitle("SSL error - Continue?");
|
||||||
|
alert.setMessage(error.toString())
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton("Yes", new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
|
public void onClick(DialogInterface dialog, int id)
|
||||||
|
{
|
||||||
|
h.proceed();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton("No", new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
|
public void onClick(DialogInterface dialog, int id)
|
||||||
|
{
|
||||||
|
h.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue