Hi,
I'm writing code to get a remote image via URL and I get the following error each time. I converted the URL to https as recommended.
This is the error I get.
URL is Optional(https://img.recipepuppy.com/627470.jpg)
2022-03-29 16:27:41.892870+1100 QantasTest[13489:314159] ATS failed system trust 2022-03-29 16:27:41.892949+1100 QantasTest[13489:314159] Connection 3: system TLS Trust evaluation failed(-9802)
2022-03-29 16:27:41.893119+1100 QantasTest[13489:314159] Connection 3: TLS Trust encountered error 3:-9802
2022-03-29 16:27:41.893212+1100 QantasTest[13489:314159] Connection 3: encountered error(3:-9802)
2022-03-29 16:27:41.894548+1100 QantasTest[13489:314159] Task <526F7B9B-ADC8-4D14-8EA6-DEAD629E7C5A>.<0> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9802])
2022-03-29 16:27:41.894666+1100 QantasTest[13489:314182] NSURLConnection finished with error - code -1200
The code I use is:
print("URL is \(String(describing: self.thumbNailUrl))")
DispatchQueue.global().async { [weak self] in
if let data = try? Data(contentsOf: self!.thumbNailUrl!) {
if let image = UIImage(data: data) {
DispatchQueue.main.async {
self?.imageView.image = image
}
}
}
}
Any suggestions?
Cheers Richard