3

How to connect to https url from iphone application ? Is there any sample code available?

Bijoy Thangaraj
  • 5,434
  • 4
  • 43
  • 70
Yogini
  • 1,713
  • 4
  • 17
  • 18

3 Answers3

1

The same way that you connect to a http URL. The Cocoa Touch API does all the hard stuff behind the scenes.

"Error Domain=kCFErrorDomainCFNetwork Code=306" means "A connection could not be established to the specified HTTP proxy." Seems that there's a problem with your networking configuration.

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
  • Hello Stephen, Thanks for reply. When I connect to http url using NSURLConnection, it is working fine. What changes I need to do to connect to https url ? When I change the url to https & keep code same as http I am getting error as :Error Domain=kCFErrorDomainCFNetwork Code=306 UserInfo=0x17ae40 "Operation could not be completed. (kCFErrorDomainCFNetwork error 306.)". Please help. What else I need to implement ? – Yogini Jun 15 '09 at 11:56
  • Maybe you should edit your question and add that information? – Stephen Darlington Jun 15 '09 at 12:18
  • Unfortunately the link is dead – hnh Mar 27 '18 at 15:48
  • @hnh Super-easy to search for the replacement link on the Apple Developer website though. – Stephen Darlington Mar 27 '18 at 15:52
  • Yes, sure. But that wasn't the point ;-) Thanks for updating! – hnh Mar 27 '18 at 16:27
  • It is a closed question from 2009... – Stephen Darlington Mar 27 '18 at 16:31
0

enter code hereIs der any way to estabilish a secure connection with the server using tcp with sslv3. I need some sample code and the way to implement. now I am just setting the readstream and writestream's property as follows

[readStream setProperty:NSStreamSocketSecurityLevelKey forKey:NSStreamSocketSecurityLevelSSLv3];

[writeStream setProperty:NSStreamSocketSecurityLevelKey forKey:NSStreamSocketSecurityLevelSSLv3];

do any one provide some sample link or sample code in order to estabilish a secure connection using tcp with sslv3

Regards, Mohammed Sadiq.

Maulik
  • 19,348
  • 14
  • 82
  • 137
0

You don't need to use anything special in order to GET information through HTTPS protocol in iOS.

  1. If you need to display HTML information, use UIWebView
  2. If you just need to POST or GET something, use NSURL in combination with NSData, NSString or something to retrieve the information contained in it.
Cœur
  • 37,241
  • 25
  • 195
  • 267
Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292