// // SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors // SPDX-License-Identifier: GPL-3.0-or-later // import Foundation import SDWebImage @objcMembers public class NCWebImageDownloaderOperation: SDWebImageDownloaderOperation { public override func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { // The pinning check if CCCertificate.sharedManager().checkTrustedChallenge(challenge) { completionHandler(.useCredential, URLCredential(trust: challenge.protectionSpace.serverTrust!)) } else { completionHandler(.performDefaultHandling, nil) } } }