开发者

how to parse a website with SSL protection in Objective C

开发者 https://www.devze.com 2023-03-29 08:53 出处:网络
I am trying to write an application that reads in data from a website, but I am currently running into an issue due to the fact that the website is being protected by SSL, and is not possible for me t

I am trying to write an application that reads in data from a website, but I am currently running into an issue due to the fact that the website is being protected by SSL, and is not possible for me to fetch the information from the website through my normal approach. Btw, this app that I am trying to write is an iph开发者_开发百科one app, so answer regarding to objective C is much appreciated. Thanks!!


First of all in ObjectiveC you can use NSURLConnection for connecting to HTTP websites. But there is an awesome wrapper on top of this called - ASIHTTP. Try it.

Now for your specific problem of accessing SSL protected sites in ObjectiveC try this -

  1. To do ssl with ASIHTTPRequest, you just need to pass a https url instead of a http one.
  2. You don't need an real SSL certificate, you can disable validation using: [request setValidatesSecureCertificate:NO];
  3. With this, you're limited by what certificate signing authorities are supported by the iphone. So long as you stick to the big names it shouldn't really be an issue. (And as per 2. you can use a self signed certificate anyway.)
  4. Check this for more info - http://tigelane.blogspot.com/2011/01/apple-itunes-export-restrictions-on.html

Hope this helps...

0

精彩评论

暂无评论...
验证码 换一张
取 消