Allow unverified ssl certificate in UIWebview

后端 未结 7 1949
北恋
北恋 2020-12-02 07:05

I\'m embedding a website in a UIWebView. During development I have it pointed at localhost. The problem is that whenever it hits a \"https://\" url it doesn\'t load. When I

7条回答
  •  执笔经年
    2020-12-02 07:26

    Using the below two methods we can allow unverified ssl in UIWebview

    -(BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;
    
    -(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
    

    I have answered in detail how to achieve this here

提交回复
热议问题