새소식

iOS/Swift

[Swift] URLSession https 인증서 신뢰

  • -
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {

 	let urlCredential = URLCredential(trust: challenge.protectionSpace.serverTrust!)
    completionHandler(.useCredential, urlCredential)
 }
728x90

'iOS > Swift' 카테고리의 다른 글

[Swift] 다른 앱 실행시키기  (0) 2022.12.04
[Swift] URLComponent  (0) 2022.11.20
[Swift] URLSession  (0) 2022.11.17
[Swift] Codable vs JSONSerialization  (1) 2022.10.15
[Swift] 접근제어  (0) 2022.09.28
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.