You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tls): assign OpenSSL and WolfSSL errors a proper error_category
Errors from ERR_get_error() (OpenSSL) and wolfSSL_get_error() (WolfSSL)
were wrapped in std::system_category(), but these are library-specific
codes, not errno values. error_code::message() therefore rendered
garbage such as "system:167772294: Unknown error 167772294".
Add a dedicated error_category for each backend whose message() decodes
the native code via the library's own string routines, and route every
conversion site through it:
- openssl_category() + make_openssl_error(), with ERR_LIB_SYS codes still
mapped to std::system_category() since their reason is a genuine errno.
- wolfssl_category() (flat enum, no SYS special-case), rendered via
wolfSSL_ERR_error_string_n.
Both categories are public (declared in the respective *_stream.hpp) so
callers can detect and compare TLS errors. Add a testErrorCategory unit
test per backend; run_tls_test_fail gains an optional client_ec
out-parameter to capture the handshake error.
Fixes#223
0 commit comments