-
-
Notifications
You must be signed in to change notification settings - Fork 7k
ssl: support Apple SecTrust configurations #18703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
icing
commented
Sep 24, 2025
- configure/cmake support for enabling the option
- supported in OpenSSL and GnuTLS backends
- when configured, Apple SecTrust is the default trust store for peer verification. When one of the CURLOPT_* for adding certificates is used, that default does not apply.
- add documentation of build options and SSL use
|
This is my suggestion on how to add this feature. We could maybe extend this to mbedTLS and wolfSSL, but I was not sure it is worth it. OpenSSL(-like)+GnuTLS should be enough for the start. The specific behaviour I designed for is: # uses Apple SecTrust
> curl https://example.com
# uses *only* certs from file.pem
> curl --cacert file.pem https://example.com
# uses *both* certs from file.pem and SecTrust
> curl --ca-native --cacert file.pem https://example.comThis would also happen for a # still uses Apple SecTrust
> curl --no-ca-native https://example.combecause I could not think of a way to decide if |
That's right it only disables the option which disables passing the flag. |
|
I don't know enough Apple to formally review this so I'm going to have to punt. I did take a look at it and left some comments though. |
3efe2dc to
ab78e43
Compare
|
Hm, this gets some new CI failures we need to check first |
- configure/cmake support for enabling the option - supported in OpenSSL and GnuTLS backends - when configured, Apple SecTrust is the default trust store for peer verification. When one of the CURLOPT_* for adding certificates is used, that default does not apply. - add documentation of build options and SSL use
- re-add backend Schannel check to not apply default BUNDLE/PATH - fix wording/formatting in SSLCERTS.md - clarify fallback option in INSTALL.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor, likely unrelated, log issue I noticed while testing, is that --doh-url seems to suppress the SSL Trust Anchors: info.
Using the -DUSE_APPLE_SECTRUST=ON dev build curl-macos-universal-clang from https://github.com/curl/curl-for-win/actions/runs/18216661900
$ CURL_CA_BUNDLE=/opt/homebrew/etc/ca-certificates/cert.pem ./curl -q --doh-url https://zero.dns0.eu/ -v https://curl.se/ --out-null
it does only say SSL certificate verified via OpenSSL..
With --doh-url <url> deleted, SSL Trust Anchors: appears as expected.
|
Good catch, @vszakats . I need to inspect the DoH code on how it tries to set ca-bundle/-path/native from the initiating transfer. Update: but when you explicity specify a CA-Bundle, as command line options or via env var, the native CA is turned off. You need to add |
Follow-up to 692c7f1 curl#19252 Follow-up to eefd03c curl#18703 Fixes curl#19724