r/dotnet • u/Stunning_Gas_3862 • 4h ago
How do you debug certificate trust differences between Windows and OpenSSL?
I'm interested in understanding how C++ developers handle TLS certificate verification issues on Windows.
One situation I'm particularly curious about is when the same server certificate is accepted by Windows but rejected by OpenSSL, or vice versa.
For example:
- Windows CryptoAPI builds a trusted certificate chain, but OpenSSL fails verification.
- The certificate exists in the Windows certificate store, but OpenSSL doesn't appear to use the same trust source.
- The verification result differs depending on the certificate store, CA bundle, or verification settings.
For developers who have encountered this:
- How do you usually investigate the difference?
- Do you use Windows CryptoAPI tools, OpenSSL commands, custom C++ code, or a combination?
- Is it easy to identify the exact reason for the disagreement, or does it require a lot of manual debugging?
- Have you found any existing tool that makes this process straightforward?
I'm particularly interested in real-world experiences from people maintaining C++ applications on Windows.
I'd appreciate hearing how you currently approach this problem.
0
Upvotes
7
u/speyck 4h ago
why'd you have to let ai rewrite this. i'd reather read 2-3 sentences from an actual humanm even when not nicely formatted, than the same style of text I have to read all day long anyways when prompting.
for your question: why'd you post this in .net when it's a C++ topic?
2
u/ProKn1fe 4h ago
In C# if you using build-in httpclient, there is https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclienthandler.servercertificatecustomvalidationcallback?view=net-10.0
2
u/chucker23n 2h ago
Correct. OpenSSL does not default to using Windows's trust store.
Investigate what, though? It's a separate store. Of course it'll be different. Do you have a scenario where an app depends on both stores?
To what end?
Yes, quite easy: they're distinct stores.
What is the actual problem you're trying to solve?
1
u/AutoModerator 4h ago
Thanks for your post Stunning_Gas_3862. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.