Skip to content

Commit

Permalink
Merge pull request #71 from vapor-community/warnings-real
Browse files Browse the repository at this point in the history
remove 4.1 warnings
  • Loading branch information
tanner0101 authored May 30, 2018
2 parents 02a4730 + 05fbcca commit a5981b0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/TLS/Certificates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ extension Certificates {
"/system/etc/security/cacerts" // Android
]

#if swift(>=4.1)
return paths.compactMap { (path: String) -> Certificates? in
guard fileExists(path) else {
return nil
}

return .certificateAuthority(
signature: .signedFile(
caCertificateFile: path
)
)
}.first
#else
return paths.flatMap { (path: String) -> Certificates? in
guard fileExists(path) else {
return nil
Expand All @@ -86,6 +99,7 @@ extension Certificates {
)
)
}.first
#endif
}
}

Expand Down

0 comments on commit a5981b0

Please sign in to comment.