mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-22 04:30:44 +00:00
Guard Security.framework usage with canImport(Security) (#614)
The certificate validation code only needs the `Security` framework, not `Darwin`.
This commit is contained in:
1 parent
15e0b9e495
commit
2a439aff65
2 files changed
+2
-2
No files matched your search
@@ -536,7 +536,7 @@ public final class NIOSSLContext {
|
||||
let conn = SSLConnection(ownedSSL: ssl, parentContext: self)
|
||||
|
||||
// If we need to turn on the validation on Apple platforms, do it here.
|
||||
#if canImport(Darwin)
|
||||
#if canImport(Security)
|
||||
switch self.configuration.trustRoots {
|
||||
case .some(.default), .none:
|
||||
conn.setCustomVerificationCallback(
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import NIOCore
|
||||
|
||||
// We can only use Security.framework to validate TLS certificates on Apple platforms.
|
||||
#if canImport(Darwin)
|
||||
#if canImport(Security)
|
||||
import Dispatch
|
||||
import Foundation
|
||||
@preconcurrency import Security
|
||||
|
||||
Reference in new issue
Block a user