Hello Kris, It seems similar to https://bugzilla.xamarin.com/show_bug.cgi?id=7664 (even if the original description is private). Still you can c.c. yourself to the bug report to get updates.
I can evaluate the trust correctly from MonoTouch itself, but not from the WebClient (and the results should be identical). So there's a bug hidden in there (and I'm looking into it). Sebastien On Sun, Oct 14, 2012 at 11:06 AM, Kris Owens <[email protected]> wrote: > I tried the same URL using safari on the simulator & device and it worked as > expected. Here's a really simple repro that throws an exception for https > but not for http: > > using (var webClient = new System.Net.WebClient()) > { > return webClient.DownloadString("https://api.imgur.com/2/stats"); > } > > (Sorry for the delay, we just had a new baby and I haven't been near a > computer) > > > On Sun, Sep 30, 2012 at 7:20 AM, Sebastien Pouliot <[email protected]> > wrote: >> >> Kris, >> >> The certificate validation process is delegated to iOS (that's where >> the 0x5 error comes from). >> >> The root certificate it trust can vary a bit by versions of iOS (the >> list gets expanded). A quick way to see if iOS itself trust the >> certificate is to use Safari (on the same device) and try the same >> URL, e.g. "https://api.imgur.com/2/upload.json". >> >> Sebastien >> >> On Sun, Sep 30, 2012 at 8:03 AM, Nic Wise <[email protected]> wrote: >> > Double check you are not using a proxy in there at all - I've had all >> > sorts of problems with the proxy support in MT, especially if you are >> > using 2 SSL servers (eg imgur and dropbox) from the same app. >> > >> > That includes things like Onavo. >> > >> > On Sat, Sep 29, 2012 at 9:27 PM, Kris Owens <[email protected]> wrote: >> >> This seems similar to >> >> https://bugzilla.xamarin.com/show_bug.cgi?id=4001, but >> >> is now showing up with a different URL. 7530 may be related too. >> >> >> >> If I make any call to https://imgur.com I get "Invalid certificate >> >> received >> >> from server. Error code: 0x5" but the same calls to http:// work fine. >> >> I'm >> >> just using WebClient without anything fancy, which previously was >> >> working >> >> fine: >> >> >> >> using (var webClient = new WebClient()) >> >> { >> >> webClient.UploadValues("https://api.imgur.com/2/upload.json", ...") >> >> } >> >> >> >> Invalid certificate received from server. Error code: 0x5 >> >> at >> >> >> >> Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates >> >> (Mono.Security.X509.X509CertificateCollection certificates) [0x000a1] >> >> in >> >> >> >> /Developer/MonoTouch/Source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs:218 >> >> at >> >> >> >> Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 >> >> () [0x00054] in >> >> >> >> /Developer/MonoTouch/Source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs:105 >> >> at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () >> >> [0x00037] in >> >> >> >> /Developer/MonoTouch/Source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs:105 >> >> at >> >> Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage >> >> (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00039] in >> >> >> >> /Developer/MonoTouch/Source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs:81 >> >> at >> >> Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback >> >> (IAsyncResult asyncResult) [0x00127] in >> >> >> >> /Developer/MonoTouch/Source/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:397 >> >> >> >> _______________________________________________ >> >> MonoTouch mailing list >> >> [email protected] >> >> http://lists.ximian.com/mailman/listinfo/monotouch >> >> >> > >> > >> > >> > -- >> > Nic Wise >> > t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise >> > b. http://www.fastchicken.co.nz/ >> > >> > mobileAgent (for FreeAgent): get your accounts in your pocket. >> > http://goo.gl/IuBU >> > Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa >> > Earnest: Self-employed? Track your business expenses and income. >> > http://earnestapp.com >> > Nearest Bus: find when the next bus is coming to your stop. >> > http://goo.gl/Vcz1p >> > London Bike App: Find the nearest Boris Bike, and get riding! >> > http://goo.gl/Icp2 >> > _______________________________________________ >> > MonoTouch mailing list >> > [email protected] >> > http://lists.ximian.com/mailman/listinfo/monotouch > > _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
