chore(common)!: replace native-certs with platform-verifier#2078
chore(common)!: replace native-certs with platform-verifier#2078VianneyRuhlmann wants to merge 2 commits into
Conversation
ff9b666 to
4b2028f
Compare
📚 Documentation Check Results📦
|
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
🔒 Cargo Deny Results📦
|
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2078 +/- ##
==========================================
- Coverage 73.50% 73.47% -0.03%
==========================================
Files 470 470
Lines 78398 78398
==========================================
- Hits 57624 57602 -22
- Misses 20774 20796 +22
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
4b2028f to
7a32a06
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3078c4dc4d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # certificate directories and parses individual cert files instead of loading a single | ||
| # bundle, adding unnecessary I/O overhead in latency-sensitive environments. | ||
| rustls-native-certs = { version = ">=0.8.1, <0.8.3", optional = true } | ||
| rustls-platform-verifier = { version = "0.6", optional = true } |
There was a problem hiding this comment.
Preserve the native-certs upper bound
On Linux/BSD, rustls-platform-verifier still loads roots through rustls-native-certs, but this new dependency no longer carries the >=0.8.1, <0.8.3 constraint that was just removed above. The workspace lock currently masks this by keeping 0.8.1, but published libdd-common users (or any lock refresh) can resolve rustls-native-certs 0.8.3+ through the platform verifier and reintroduce the certificate-directory probing/parsing overhead that the deleted comment says this crate was intentionally avoiding in latency-sensitive environments. Please keep an explicit compatible constraint or otherwise pin/override the transitive version for the Linux verifier path.
Useful? React with 👍 / 👎.
|
Can you share a bit more on info on why we're doing this migration and why it is safe? Just to make sure I understand what changes here, as getting this wrong means customers not getting data (e.g. because some TLS connections fail due to missing certificates). |
|
The main reason I'm trying to do it now is because it makes loading the certificate lazy on macos. This helps mitigating a bug in dd-trace-py due to the macos Security.framework api not being thread safe. |
I'm not very familiar with it either, which is why I was kinda pointing out that getting this wrong can have a very high cost (ask me how I know.... #1796 / DataDog/dd-trace-rb#5508 ) so it's worth being very careful with changes here. |
What does this PR do?
Replace rustls-native-certs with rustls-platform-verifier as recommended in rustls-native-certs.
Motivation
Potential fix to a crash in dd-trace-py on macos
Additional Notes
Anything else we should know when reviewing?
How to test the change?
Describe here in detail how the change can be validated.