I am using iOS sdk5.0. I am hitting a link using NSURLConnection and creating a request. But my control is not going into didReceiveAuthenticationChallenge method. Is didReceiveAuthenticationChallenge not called in iOS5.0?
According to Docs of NSURLConnectionDelegate
connection:canAuthenticateAgainstProtectionSpace:
connection:didReciveAuthenticationChallenge:
connection:didCancelAuthenticationChallenge:
are deprecated and new code should adopt
connection:willSendRequestForAuthenticationChallenge
The older delegates will still be called for compatibility, but incur more latency in dealing with the authentication challenge.
I was having the same problem (see my comment above). In my searches, I came across this gist: https://gist.github.com/1675763 . I tried the code in the AUTH_NEW path. The delegate still wasn't being called. Then I noticed the comment on line 40: "Perhaps iOS 5 can't support DSA signature algorism."
I did some searches, and found nothing to indicate that this was a limitation was a problem. Finally, in desperation, I changed this. I was using java's keytool (Java's reinvented version of openssl+) to generate my self-signed cert. It uses DSA by default. Out of desperation, I used a flag to force it to use RSA. Then the delegate got called, and the code in the gist above worked.
I still have yet to see any documentation that says you can't use DSA. openssl seems to use RSA by default, so folks using that probably never run into this.
Short story: check your cert and make sure it is signed with RSA and not DSA.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With