@DTS Engineer Thank you so much for your response!
Here is my situation:
I am running an older version of Mongoose Server (an embedded web server) to serve files. The web server uses a loopback address (127.0.0.x) and is primarily used to download necessary files for my app.
However, recently, accessing this web server has started triggering security warnings, which negatively impact the user experience (UX). I am looking for a solution to this issue.
I have a few questions:
"If you must support web browsers, you have to live with the dire security warnings that they’ll present when you connect to a local server" > Does this mean there is no possible solution to remove these security warnings?
I found a method online to bypass certificate validation. Would this affect security even though I am using a loopback address?
func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
print("[Gyeom] HTTPS Host: \(challenge.protectionSpace.host)")
if challenge.protectionSpace.host.contains("127.0.0") {
let urlCredential = URLCredential(trust: challenge.protectionSpace.serverTrust!)
completionHandler(.useCredential, urlCredential)
} else {
completionHandler(.performDefaultHandling, nil)
}
}
Are there any other possible solutions to this problem?
Thank you!! 😊