İçeriğe geç

Devre dışı TLS doğrulaması (ARCH9119)

Anahtar swift.security.disabled-tls-validation · Önem error · Kategori security · CWE CWE-295

Her sunucu güvenini kabul eden URLSession temsilcilerini (her challenge için URLCredential(trust:)) ve kodda ayarlanan NSAllowsArbitraryLoads tarzı atlatmaları işaretler.

func urlSession(_ s: URLSession, didReceive c: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) {
return (.useCredential, URLCredential(trust: c.protectionSpace.serverTrust!))
}
// evaluate the trust (SecTrustEvaluateWithError) or pin the certificate before accepting

Sunucu güvenini değerlendirin ya da sabitleyin; asla koşulsuz kabul etmeyin.