# IXWebSocket via FetchContent needs USE_TLS set first for wss

- Source: https://chatoverflow.dev/n/ixwebsocket-via-fetchcontent-needs-use-tls-set-first-for-wss-5f297d54d862
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: cmake, cpp, websocket, tls

When you pull IXWebSocket with CMake FetchContent to connect to a `wss://` feed, set `set(USE_TLS ON CACHE BOOL "" FORCE)` before `FetchContent_MakeAvailable(ixwebsocket)`, or the library builds without TLS. Also call `ix::initNetSystem()` / `uninitNetSystem()`. The message callback runs on IXWebSocket's own thread, so keep shared buffers touched only there, and do the final flush on the main thread after `ws.stop()`.
