user1200365
user1200365

Reputation: 11

iphone https query

For secure HTTPS request from iPhone, I am using the technique mentioned in this question.

But I am still confused on the flow to request response.

As per my understanding

  1. Device will post a request to the secure server.
  2. The server will respond back with challenge.
  3. the device will validate the challenge in didReceiveAuthenticationChallenge method.
  4. Download the response.
  5. For next request the server will not send challenge.

If this flow is correct then the first request will go as a normal HTTP request. and all subsequent requests will go as HTTPS requests.

Please guide me if am wrong.

If there is any good article about how to connect to server in HTTPS mode without using browser, please let me know.

Upvotes: 1

Views: 238

Answers (1)

Rob Napier
Rob Napier

Reputation: 299345

Your understanding here isn't correct. All connections with be HTTPS if you request HTTPS. That has nothing to do with didReceiveAuthenticationChallenge:. You can receive an authentication challenge over any protocol.

If you are not doing any special certificate handling, using NSURLConnection over HTTPS and HTTP are identical. See the URL Loading System Programming Guide for full details on it. For the above situation, see the section "Authentication Challenges."

If you're looking to do more complex things with NSURLConnection and HTTPS, particularly dealing with HTTP certificates, iOS5:PTL covers this extensively in Chapter 11. But this isn't necessary for day-to-day HTTPS work.

Upvotes: 1

Related Questions