@@ -8351,26 +8351,30 @@ then
83518351
83528352 case $host_os in
83538353 *darwin*)
8354- # Creates the HAVE_SECURITY_SECXXX_H macros in config.h
8354+ # Headers used for MacOS default system CA certs behavior. Only MacOS SDK will have this header
83558355 AC_CHECK_HEADERS ( [ Security/SecTrustSettings.h] )
8356+ # Headers used for Apple native cert validation. All device SDKs should have these headers
83568357 AC_CHECK_HEADERS ( [ Security/SecCertificate.h] )
83578358 AC_CHECK_HEADERS ( [ Security/SecTrust.h] )
83588359 AC_CHECK_HEADERS ( [ Security/SecPolicy.h] )
83598360 # Either Security/SecTrustSettings (for MacOS cert loading), or the
83608361 # trio of Security/SecCertificate.h, Security/SecTrust.h, and
8361- # Security/SecPolicy.h (for native trust APIs other apple devices)
8362- # must be present
8363- AS_IF ( [ test -n "$ac_cv_header_Security_SecTrustSettings_h" \
8364- || (test -n "$ac_cv_header_Security_SecCertificate_h" \
8365- && test -n "$ac_cv_header_Security_SecTrust_h" \
8366- && test -n "$ac_cv_header_Security_SecPolicy_h")] ,
8362+ # Security/SecPolicy.h (for native trust APIs on other apple devices)
8363+ # must be present. Default to SecTrustSettings method on MacOS.
8364+ AS_IF ( [ test "$ac_cv_header_Security_SecTrustSettings_h" = "yes" \
8365+ || (test "$ac_cv_header_Security_SecCertificate_h" = "yes" \
8366+ && test "$ac_cv_header_Security_SecTrust_h" = "yes" \
8367+ && test "$ac_cv_header_Security_SecPolicy_h" = "yes")] ,
8368+ [
8369+ LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
8370+ AS_IF ( [ test "$ac_cv_header_Security_SecTrustSettings_h" != "yes"] ,
83678371 [
8368- LDFLAGS ="$LDFLAGS -framework CoreFoundation -framework Security "
8369- ] ,
8370- [
8371- AC_MSG_ERROR ( [ Unable to find Apple Security.framework headers ] )
8372- ]
8373- )
8372+ AM_CFLAGS ="$AM_CFLAGS -DWOLFSSL_APPLE_NATIVE_CERT_VALIDATION "
8373+ ] )
8374+ ] ,
8375+ [
8376+ AC_MSG_ERROR ( [ Unable to find Apple Security.framework headers ] )
8377+ ] )
83748378 ;;
83758379 esac
83768380fi
0 commit comments