I just sent this to Bryan -

Try https://www.google.com/

Still bombs out.
Then remove the custom cert validation and it works.

Dragonslair.net is my internal network, I forgot to mention that..

Stephan

Sent from my Windows Phone
 ------------------------------
From: Jonathan Pryor-2 [via Mono for
Android]<[email protected]>
Sent: 02.04.2013 21:17
To: Stephan Steiner <[email protected]>
Subject: Re: handling webservices with self-signed certificates

On Apr 2, 2013, at 12:28 PM, Stephan Steiner <[hidden
email]</user/SendEmail.jtp?type=node&node=5713091&i=0>>
wrote:
> Ran into this issue this afternoon: Create new android app with the
following code

I am unable to reproduce. Perhaps my server with unsigned cert differs
somehow from yours? (I'm unable to use dragonslair.net, as it's
inaccessible to me.)

What's plausible -- yet doesn't make any sense -- is if button_Click() were
executed before ServicePointManager.ServerCertificateValidationCallback
were assigned, that would explain your behavior. Though that doesn't seem
possible.

In any event, I'd suggest moving the
ServicePointManager.ServerCertificateValidationCallback initialization
before your button.Click initialization. Or better, move it into an
Application.OnCreate() method so that it's only initialized once per
process:

    [Application]
    public class MyAp : Android.App.Application {
        public MyAp (IntPtr handle, JniHandleOwnership transfer)
            : base (handle, transfer)
        {
        }

        public override void OnCreate ()
        {
            ServicePointManager.ServerCertificateValidationCallback =
validatedCertificate;
        }

        private bool validatedCertificate(object sender, X509Certificate
certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
        {
            return true;
        }
    }

 - Jon

_______________________________________________
Monodroid mailing list
[hidden email] </user/SendEmail.jtp?type=node&node=5713091&i=1>

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid


------------------------------
 If you reply to this email, your message will be added to the discussion
below:
http://mono-for-android.1047100.n5.nabble.com/handling-webservices-with-self-signed-certificates-tp5713085p5713091.html
 To unsubscribe from handling webservices with self-signed certificates, click
here<http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5713085&code=c3RlcGhhbi5zdGVpbmVyQGdtYWlsLmNvbXw1NzEzMDg1fC0xNjMyOTU2NzQy>
.
NAML<http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/handling-webservices-with-self-signed-certificates-tp5713085p5713092.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to