1

I am making an iPhone app with the aim of connecting to a wifi hotspot.
The connection to the hotspot is made with a https web page.

In order to identify if the web page is a real hotspot, not a fake hotspot to steal logins, I want to check the https certificate of the web page. The web page is loaded in a UIWebview.

Questions : How I can retreive informations about the https certificate ?

EDIT : I think that should be possible with the NSURLConnection but with a UIWebView, I haven't the NSURLConnection object.

Thanks for your answers !

2
  • Every cert is signed. Do you want to keep a list of trustworthy signers? Commented Sep 20, 2011 at 19:35
  • Yes, I already have the signature of the true cert, so juste compare the certificate. Commented Sep 20, 2011 at 19:37

1 Answer 1

2

You can't do this with a UIWebView, but you can using the canAuthenticateAgainstProtectionSpace: delegate method for NSURLConnection. You can use this delegate method to create an NSData copy of the certificate you want to verify, and then compare it against a locally stored copy.

That said, as indicated above it doesn't really add much security, and there are better ways of achieving what you want to achieve.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I have also find this solution here stackoverflow.com/questions/5675808

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.