I am trying to connect to my ASP.NET Core API which I am running on my other computer. I want to try to add data using a POST request. I am getting these error messages:
Connection 6: default TLS Trust evaluation failed(-9813)
Connection 6: TLS Trust encountered error 3:-9813
Connection 6: encountered error(3:-9813)
The error description is:
The certificate for this server is invalid. You might be connecting to a server that is pretending to be “192.168.0.100” which could put your confidential information at risk.
let jsonData = try? JSONSerialization.data(withJSONObject: data)
let url = URL(string: "https://192.168.0.100:5001/api/Trips")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data, error == nil else {
print(error?.localizedDescription)
return
}
let responseJSON = try? JSONSerialization.jsonObject(with: data, options: [])
if let responseJSON = responseJSON as? [String: Any] {
}
}
task.resume()
I am not concerned with any risk at the moment, because this is just for developing purposes. Is there a way to trust the connection or to ignore the check completely?