public override void OnReceivedSslError(Android.Webkit.WebView view, SslErrorHandler handler, SslError error)
 {
     handler.Proceed();
     //AlertDialog.Builder builder = new AlertDialog.Builder((Activity)Forms.Context);
     //AlertDialog ad = builder.Create();
     //string message = "Zertifikat Fehler";
     //switch (error.PrimaryError)
     //{
     //    case SslErrorType.Untrusted:
     //        message = "Zertifikat ist nicht vertrauenswürdig."; break;
     //    case SslErrorType.Expired:
     //        message = "Zertifikat ist abgelaufen."; break;
     //    case SslErrorType.Idmismatch:
     //        message = "Zertifikat ID ist fehlerhaft."; break;
     //    case SslErrorType.Notyetvalid:
     //        message = "Zertifikat ist noch nicht gültig."; break;
     //}
     //message += " Möchten Sie trotzdem fortfahren?";
     //ad.SetTitle("SSL Zertifikat Fehler");
     //ad.SetMessage(message);
     //ad.SetButton("OK", (sender, args) =>
     //{
     //    handler.Proceed();
     //});
     //ad.SetButton2("Cancel", (sender, args) =>
     //{
     //    handler.Cancel();
     //});
     //ad.SetIcon(Android.Resource.Drawable.IcDialogAlert);
     //ad.Show();
 }
Beispiel #2
0
            // Continue only when there is a ssl warnings.
            public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
            {
                String message = "SSL Certificate error.";

                switch (error.PrimaryError)
                {
                case SslErrorType.Untrusted:
                    message = "The certificate authority is not trusted.";
                    break;

                case SslErrorType.Expired:
                    message = "The certificate has expired.";
                    break;

                case SslErrorType.Idmismatch:
                    message = "The certificate Hostname mismatch.";
                    break;

                case SslErrorType.Notyetvalid:
                    message = "The certificate is not yet valid.";
                    break;
                }
                message += "\"SSL Certificate Error\" Do you want to continue anyway?.. YES";

                //handler.proceed();
                handler.Proceed();
            }
            public override void OnReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
            {
                if (sslContinue == null)
                {
                    var certComparer = new SslCertificateEqualityComparer();
                    sslContinue = new HashSet <SslCertificate>(certComparer);
                    inProgress  = new Dictionary <SslCertificate, List <SslErrorHandler> >(certComparer);
                }

                List <SslErrorHandler> handlers;

                if (inProgress.TryGetValue(error.Certificate, out handlers))
                {
                    handlers.Add(handler);
                    return;
                }

                if (sslContinue.Contains(error.Certificate))
                {
                    handler.Proceed();
                    return;
                }

                inProgress[error.Certificate] = new List <SslErrorHandler>();

                AlertDialog.Builder builder = new AlertDialog.Builder(this.activity);
                builder.SetTitle("Security warning");
                builder.SetIcon(global::Android.Resource.Drawable.IcDialogAlert);
                builder.SetMessage("There are problems with the security certificate for this site.");

                builder.SetNegativeButton("Go back", (sender, args) =>
                {
                    UpdateInProgressHandlers(error.Certificate, h => h.Cancel());
                    handler.Cancel();
                });

                builder.SetPositiveButton("Continue", (sender, args) =>
                {
                    sslContinue.Add(error.Certificate);
                    UpdateInProgressHandlers(error.Certificate, h => h.Proceed());
                    handler.Proceed();
                });

                builder.Create().Show();
            }
Beispiel #4
0
 public override void OnReceivedSslError(Android.Webkit.WebView view, SslErrorHandler handler, SslError error)
 {
     if (FormsWebViewRenderer.IgnoreSslGlobally)
     {
         handler.Proceed();
     }
     else
     {
         handler.Cancel();
     }
 }
        public override void OnReceivedSslError(Android.Webkit.WebView view, SslErrorHandler handler, SslError error)
        {
            /*SslCertificate sslCertificateserver = error.Certificate;
             * String key = KeyStore.DefaultType;
             * KeyStore keyStore = KeyStore.GetInstance(key);
             * keyStore.Load(null, null);
             * Certificate cer = keyStore.GetCertificate("ca");
             *
             * if (cer!=null)
             * {
             *  X509Certificate x509 = (Java.Security.Cert.X509Certificate)cer;
             *  SslCertificate sslcert = new SslCertificate(x509);
             *
             * }*/

            switch (error.PrimaryError)
            {
            case SslError.SslUntrusted:
                handler.Proceed();

                break;

            case SslError.SslExpired:
                break;

            case SslError.SslIdmismatch:
                break;

            case SslError.SslNotyetvalid:
                handler.Proceed();
                break;

            default:
                break;
            }
        }
        public override void OnReceivedSslError(Android.Webkit.WebView view, SslErrorHandler handler, SslError error)
        {
            if (Reference == null || !Reference.TryGetTarget(out FormsWebViewRenderer renderer))
            {
                return;
            }
            if (renderer.Element == null)
            {
                return;
            }

            if (FormsWebViewRenderer.IgnoreSSLGlobally)
            {
                handler.Proceed();
            }
            else
            {
                handler.Cancel();
                renderer.Element.Navigating = false;
            }
        }
 public override void OnReceivedSslError(WebView view, SslErrorHandler handler, SslError error)
 {
     handler.Proceed();
 }
 public override void OnReceivedSslError(Android.Webkit.WebView view, SslErrorHandler handler, SslError error)
 {
     Log.Info("Error", "Exception caught!");
     handler.Proceed();
 }
		public override void OnReceivedSslError (WebView view, SslErrorHandler handler, Android.Net.Http.SslError error)
		{
			System.Diagnostics.Debug.WriteLine ("OnReceivedSslError: {0}", error);
			handler.Proceed ();
		}
Beispiel #10
0
 public override void OnReceivedSslError(Android.Webkit.WebView view, SslErrorHandler handler, Android.Net.Http.SslError error)
 {
     handler.Proceed();
 }
 /// <summary>
 /// Webview recieves a SSL error,
 /// Proceeds past any error
 /// </summary>
 /// <param name="view"></param>
 /// <param name="handler"></param>
 /// <param name="error"></param>
 public override void OnReceivedSslError(WebView view, SslErrorHandler handler, global::Android.Net.Http.SslError error)
 {
     // TODO: configable
     handler.Proceed();
 }