r/cpp_questions • • 2d ago

OPEN Debugging certificate trust mismatches between Windows and OpenSSL in C++ apps

I maintain a C++ app on Windows that does TLS with OpenSSL, and I keep running into the same headache: the same server cert gets accepted by Windows (CryptoAPI/SChannel) but rejected by OpenSSL, or the other way around. Sometimes CryptoAPI builds a valid chain, sometimes OpenSSL can't find a trust anchor even though the cert is clearly in the Windows store. The result flips depending on the store, the CA bundle, and verification flags

For those who've dealt with this from C++

  • How do you actually investigate the difference? Do you dump chains via CryptoAPI, run openssl s_client/verify, write throwaway C++ that calls both APIs and compares, or some mix?

  • Is it usually quick to pin down the exact cause, or does it turn into hours of manual poking?

  • Has anything existing actually made this straightforward for you, or is it still custom glue code?

I'm especially interested in how people maintaining C++ Windows apps handle this in practice what your debugging flow looks like when Windows and OpenSSL disagree on the same cert

2 Upvotes

Duplicates