Bladeren bron

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

Robert Rasmussen 10 jaren geleden
bovenliggende
commit
fb8c54c869
1 gewijzigde bestanden met toevoegingen van 8 en 1 verwijderingen
  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 {