Fix iOS build break and modernize macOS Keychain cert loading (#2455)
* Replace deprecated SecTrustCopyAnchorCertificates on macOS SecTrustCopyAnchorCertificates was deprecated in macOS 13. Switch to SecTrustSettingsCopyCertificates, iterating over the System, Admin, and User trust domains to retain equivalent coverage of anchor certificates. * Restrict Keychain cert loading to macOS TARGET_OS_MAC is true on all Apple platforms including iOS, tvOS, and watchOS, which caused the keychain enumeration path to be compiled on iOS where SecTrustSettingsCopyCertificates is unavailable. Narrow the auto-enable and the Security.h include guards to TARGET_OS_OSX, and emit an explicit #error when the user defines CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN on a non-macOS Apple platform, directing them to use set_ca_cert_path() with a bundled CA file. Addresses the iOS build break reported in #2454. * Add iOS header parse check to CI Run a cross-compile syntax check against the iOS SDK to catch accidental use of macOS-only APIs or guards (e.g. TARGET_OS_MAC vs TARGET_OS_OSX) that would silently break iOS builds. Also verify that defining CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN on iOS fires the expected #error. iOS is not officially supported as a runtime target; this job only guarantees the header stays parse-clean on iOS toolchains.
Y
yhirose committed
1ff0c8588d7a2c1baa251e8d615e86301526d8ec
Parent: b1cc809
Committed by GitHub <noreply@github.com>
on 5/23/2026, 12:39:45 PM