title: Allow self signed certificates using WKWebView
body: <p>I have the following code but I don't know why my webview is not loading.</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
      loadWebview(env_url:"https://myurl.com")
  }
  
  func loadWebview(env_url : String){
  
      let config = WKWebViewConfiguration()
      let controller = WKUserContentController()
      config.userContentController = controller
      //only https is allowed
      let url = URL(string: env_url)
      if let optional_url = url {
          let url_request = URLRequest(url: optional_url)
          webview = WKWebView(frame: self.view.frame, configuration: config)
          webview?.load(url_request)
          webview?.allowsBackForwardNavigationGestures = true
          webview?.navigationDelegate = self
          webview?.uiDelegate = self
          view.addSubview(webview!)
  
      }
      else{
          showAlertDebug(message: "Invalid URL")
      }
  }
  
  extension WebViewController : WKNavigationDelegate {
  func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping ((WKNavigationActionPolicy) -&gt; Void)) {
  
      decisionHandler(.allow)
  }
  
  func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -&gt; Void) {
      let cred = URLCredential(trust: challenge.protectionSpace.serverTrust!)
      completionHandler(.useCredential, cred)
  }
  }
  
  extension WebViewController : WKUIDelegate {
  
  }
  </code></pre>