aboutsummaryrefslogtreecommitdiffstats
path: root/wpadebug
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-06-07 14:27:10 (GMT)
committerJouni Malinen <j@w1.fi>2013-06-07 17:21:00 (GMT)
commit56cb4e1788b2550c4dc4fc8d2b4190bdecb3d35b (patch)
tree709e2e698cfcee31a65aacd0d55bb85d1c046629 /wpadebug
parentaa20e1a1fb89d797e9628bbfc12139bda7b55144 (diff)
downloadhostap-56cb4e1788b2550c4dc4fc8d2b4190bdecb3d35b.zip
hostap-56cb4e1788b2550c4dc4fc8d2b4190bdecb3d35b.tar.gz
hostap-56cb4e1788b2550c4dc4fc8d2b4190bdecb3d35b.tar.bz2
wpadebug: Add option to ignore SSL errors
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpadebug')
-rw-r--r--wpadebug/src/w1/fi/wpadebug/WpaWebViewActivity.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/wpadebug/src/w1/fi/wpadebug/WpaWebViewActivity.java b/wpadebug/src/w1/fi/wpadebug/WpaWebViewActivity.java
index 7046439..a7c54fc 100644
--- a/wpadebug/src/w1/fi/wpadebug/WpaWebViewActivity.java
+++ b/wpadebug/src/w1/fi/wpadebug/WpaWebViewActivity.java
@@ -9,11 +9,15 @@
package w1.fi.wpadebug;
import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
+import android.net.http.SslError;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
+import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
@@ -110,5 +114,33 @@ public class WpaWebViewActivity extends Activity
description + " (URL=" + failingUrl + ")",
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();
+ }
}
}