Verify WebSocketClient certificates with CryptoAPI on Windows

SSLClient verifies the server certificate chain with CryptoAPI on
Windows by default, while WebSocketClient always left it to the TLS
backend, whose snapshot of the Windows store lacks the roots Windows
fetches on demand. A wss:// connection could fail against a host that
SSLClient connects to.

WebSocketClient now makes the same decision through a shared helper,
and gets enable_windows_certificate_verification() to turn it off.

Fix #2685
This commit is contained in:
yhirose committed 2026-11-20 12:36:14 -05:00
1 parent 9458c27c7c
commit a6ab971a3f
4 files changed
+79 -10

No files matched your search

+1 -1
View File
@@ -252,7 +252,7 @@ On Windows, the CryptoAPI check can also be turned off at runtime. The TLS backe
cli.enable_windows_certificate_verification(false);
```
`WebSocketClient` does not use CryptoAPI; the TLS backend always verifies its chain.
`WebSocketClient` verifies the same way and has the same `enable_windows_certificate_verification()`.
> [!NOTE]
> When using SSL, it seems impossible to avoid SIGPIPE in all cases, since on some operating systems, SIGPIPE can only be suppressed on a per-message basis, but there is no way to make the OpenSSL library do so for its internal communications. If your program needs to avoid being terminated on SIGPIPE, the only fully general way might be to set up a signal handler for SIGPIPE to handle or ignore it yourself.