소스 검색

[Issue #610] Added temporary workaround for SecCertificate array compiler crash.

Robert Rasmussen 10 년 전
부모
커밋
fb8c54c869
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      Source/ServerTrustPolicy.swift

+ 8 - 1
Source/ServerTrustPolicy.swift

@@ -178,7 +178,14 @@ public enum ServerTrustPolicy {
                 serverTrustIsValid = trustIsValid(serverTrust)
             } else {
                 let serverCertificatesDataArray = certificateDataForTrust(serverTrust)
-                let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates)
+
+                //======================================================================================================
+                // The following `[] +` is a temporary workaround for a Swift 2.0 compiler error. This workaround should
+                // be removed once the following radar has been resolved:
+                //   - http://openradar.appspot.com/radar?id=6082025006039040
+                //======================================================================================================
+
+                let pinnedCertificatesDataArray = certificateDataForCertificates([] + pinnedCertificates)
 
                 outerLoop: for serverCertificateData in serverCertificatesDataArray {
                     for pinnedCertificateData in pinnedCertificatesDataArray {