diff --git a/Sources/NIOSSL/SSLContext.swift b/Sources/NIOSSL/SSLContext.swift index 0a622bea..d2c2b839 100644 --- a/Sources/NIOSSL/SSLContext.swift +++ b/Sources/NIOSSL/SSLContext.swift @@ -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( diff --git a/Sources/NIOSSL/SecurityFrameworkCertificateVerification.swift b/Sources/NIOSSL/SecurityFrameworkCertificateVerification.swift index 34273b3f..d67a3b0b 100644 --- a/Sources/NIOSSL/SecurityFrameworkCertificateVerification.swift +++ b/Sources/NIOSSL/SecurityFrameworkCertificateVerification.swift @@ -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