Skip to content

Commit a1d7684

Browse files
committed
added CMake support for new Apple native certificate verification
1 parent 0244c2a commit a1d7684

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,21 +1721,23 @@ if(WOLFSSL_SYS_CA_CERTS)
17211721
override_cache(WOLFSSL_SYS_CA_CERTS "no")
17221722
elseif(APPLE)
17231723
check_include_file("Security/SecTrustSettings.h" HAVE_SECURITY_SECTRUSTSETTINGS_H)
1724-
if(NOT HAVE_SECURITY_SECTRUSTSETTINGS_H)
1725-
message("Can't enable system CA certs without Security/SecTrustSettings.h.")
1726-
override_cache(WOLFSSL_SYS_CA_CERTS "no")
1727-
else()
1724+
check_include_file("Security/SecCertificate.h" HAVE_SECURITY_SECCERTIFICATE_H)
1725+
check_include_file("Security/SecTrust.h" HAVE_SECURITY_SECTRUST_H)
1726+
check_include_file("Security/SecPolicy.h" HAVE_SECURITY_SECPOLICY_H)
1727+
if(HAVE_SECURITY_SECTRUSTSETTINGS_H OR (HAVE_SECURITY_SECCERTIFICATE_H
1728+
AND HAVE_SECURITY_SECTRUST_H
1729+
AND HAVE_SECURITY_SECPOLICY_H))
17281730
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
17291731
if(NOT CORE_FOUNDATION_FRAMEWORK)
1730-
message("Can't enable system CA certs without CoreFoundation framework.")
1731-
override_cache(WOLFSSL_SYS_CA_CERTS "no")
1732+
message(FATAL_ERROR "Can't enable system CA certs without CoreFoundation framework.")
17321733
else()
17331734
find_library(SECURITY_FRAMEWORK Security)
17341735
if(NOT SECURITY_FRAMEWORK)
1735-
message("Can't enable system CA certs without Security framework.")
1736-
override_cache(WOLFSSL_SYS_CA_CERTS "no")
1736+
message(FATAL_ERROR "Can't enable system CA certs without Security framework.")
17371737
endif()
17381738
endif()
1739+
else()
1740+
message(FATAL_ERROR "Can't enable system CA certs without Apple Security.framework headers.")
17391741
endif()
17401742
endif()
17411743

0 commit comments

Comments
 (0)