ios - Print at console the information of a website -


i've made server runs https website. want print out information of website on console in xcode.

to that, added following viewcontroller.m:

- (void)viewdidload {     [super viewdidload];     nserror *error;     nsstring *address = [nsstring stringwithformat: @"https://54.169.239.78:3001"];     nsurl *url = [nsurl urlwithstring:address];     nsstring *theweb = [nsstring stringwithcontentsofurl:url encoding:nsasciistringencoding error:&error];     nslog(@"%@", theweb); } 

however, results (null). in addition, error:

nsurlsession/nsurlconnection http load failed (kcfstreamerrordomainssl, -9813)

even though have allowed app transport security in info.plist

what's wrong?

issue certificate only. if have set plist this.enter image description here

if want verify thing change url (https://developer.apple.com/) of website in code , update code as:

- (void)viewdidload {     [super viewdidload];     // additional setup after loading view, typically nib.     nserror *error;     nsstring *address = [nsstring stringwithformat: @"https://developer.apple.com/"];     nsurl *url = [nsurl urlwithstring:address];     nsstring *theweb = [nsstring stringwithcontentsofurl:url encoding:nsasciistringencoding error:&error];     nslog(@"%@", theweb); } 

i have tried has displayed content.

you need real ssl certificate. here link certificates regarding details , self signed certificates have been discussed on here: certificate details


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -