GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix iOS build break and modernize macOS Keychain cert loading by yhirose · Pull Request #2455 · yhirose/cpp-httplib

Conversation

@yhirose

@yhirose yhirose commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace deprecated SecTrustCopyAnchorCertificates with SecTrustSettingsCopyCertificates, iterating over the System/Admin/User trust domains
  • Restrict the CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN auto-enable and Security.h include guards from TARGET_OS_MAC (true on all Apple platforms) to TARGET_OS_OSX (macOS only). Emit an explicit #error if the user defines the macro on iOS/tvOS/watchOS
  • Add a lightweight iOS header parse check to CI (cross-compile syntax-only, not a runtime support promise)

Addresses the iOS build break reported in #2454, with a different approach (root cause fix rather than #ifdef wrapping).

Test plan

  • make test and make test_split pass on macOS with all SSL backends
  • SSLClientTest.ServerCertificateVerification1_Online confirms Keychain loading still works via the new API
  • Cross-compiled -fsyntax-only against iOS SDK 26.2 with arm64-apple-ios16.0:
    • Without explicit CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN → clean compile
    • With it defined → expected #error fires
  • New CI job exercises both cases on macos-latest

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
yhirose added 3 commits May 23, 2026 07:01
@yhirose
Replace deprecated SecTrustCopyAnchorCertificates on macOS
ba31275
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.
@yhirose
Restrict Keychain cert loading to macOS
e1fc507
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.
@yhirose
Add iOS header parse check to CI
88a9215
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.
@yhirose
yhirose merged commit 1ff0c85 into master May 23, 2026
39 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@yhirose
yhirose deleted the fix-2454-apple-cert-handling branch May 25, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@yhirose
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.