Who's the intermediary or root CA who signed the cert? They might not be one
of the trusted roots on the iPhone. You can intercept the validation call
like this:

System.Net.ServicePointManager.ServerCertificateValidationCallback =
(sender, certificate, chain, sslPolicyErrors) => true;

Returning true will allow the connect to succeed no matter what state the
certificate is in. Of course, this is just to get yourself over the hurdle
for the moment. Replace that lambda with a fuller-featured diagnostic method
to find out exactly what is going on with the cert.

See:
http://msdn.microsoft.com/en-us/library/system.net.security.remotecertificatevalidationcallback.aspx

Hope this helps,

-Oisin

On Thu, May 12, 2011 at 12:55 AM, PCSnob <[email protected]> wrote:

> I am working on an iPhone app that needs to connect to a WCF service over
> https.
>
> I have managed to get the application to work fine over HTTP, but when I
> changed it over to https, I get the error "An error occurred verifying
> security for the message".
>
> I would like to note that we are able to connect to the WCF service over
> https using a windows phone 7 version of the app, so we know the web
> service
> is working fine (certificate is good, etc).  Also as noted, we managed to
> connect to it using the iphone but via http.
>
> I have the following code in the iphone app to connect via the webservice:
>
>
> BasicHttpBinding binding = new BasicHttpBinding();
> binding.Security.Mode =
> BasicHttpSecurityMode.TransportWithMessageCredential;
>
> Service1Client dataclient = new Service1Client(binding, new
> EndpointAddress("https://serviceurlgoeshere";));
>
> dataclient.ClientCredentials.UserName.Username = "TestLogin";
> dataclient.ClientCredentials.Username.Password = "testpass";
>
>
> //Event handler to handle the asynchronous CompletedEventArgs here
> //Call the Async method
>
>
> Any help would be greatly appreciated, thanks
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/Connecting-to-WCF-via-HTTPS-tp3516496p3516496.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>



-- 

---
404 signature missing
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to