Upload HTTPS URL to UIWebView

I am starting to program the iPhone, and I have a big problem that I cannot solve.

So, I have UIWebview , I can download HTTP URLs without any problems:

 NSString urlAdress; urlAdress = @"http://servername"; NSURL *url = [NSURL URLWithString:urlAdress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; 

Its working, my page loads in my UIwebView, but when I replace:

 urlAdress = @"http://servername"; 

by

 urlAdress = @"https://servername"; 

I have a blank screen.

I read it normally, but is there an easy way to load the https url into my webview?
I read about ASIHTTPRequest , but I could not implement it.

I just want to download the https urls .

+7
source share
1 answer

Try the following:

 - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { return YES; } - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; } 
+6
source

All Articles