HowTo: Call iPhone Web Service to WCF with Certificate Authentication

We are an .Net store, we are currently developing an iPhone application that requires the application to call the WCF web service. Our WCF services are protected by x509 certification for authentication purposes.

I searched the Internet for an example on how to do the following:

  • Deploy the certificate using the iPhone app.
  • Use this certificate in a web service call for a WCF service.

Any understanding of how this can be achieved would be greatly appreciated.

+4
source share
1 answer

You can use the NSURLConnection API in asynchronous mode. You will need to implement an object with the NSURLConnectionDelegate protocol (http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) .

The delegate will receive a call to the connection:didReceiveAuthenticationChallenge: method when the server is threatened with a certificate.

See the Apple manual for the URL loading system (http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)

To download the SSL certificate from the package, see this fooobar.com/questions/267436 / ... :

0
source

Source: https://habr.com/ru/post/1300802/


All Articles