YemenJPT/YemenJPT-AI-Skills / skills/core/boost-asio-pro
boost-asio-pro
VerifiedUse when writing or reviewing asynchronous C++ networking code with Boost.Asio or standalone Asio — TCP/UDP servers and clients, SSL/TLS, timers, strands, io_context, co_spawn, awaitable, async_read/async_write, asio::spawn, yield_context, or pre-C++20 completion-handler callbacks.
| File | Kind | Size |
|---|---|---|
| README.ar.md | markdown | 4.3 KB |
| README.en.md | markdown | 2.9 KB |
| SKILL.md | skill md | 13.9 KB |
| references/build.md | markdown | 3.0 KB |
| references/classic-boost.md | markdown | 1.7 KB |
| references/coroutines.md | markdown | 16.1 KB |
| references/pre-cpp20.md | markdown | 8.2 KB |
| references/ssl.md | markdown | 1.2 KB |
references/ssl.md
View on GitHub# SSL/TLS
Applies to every style — `ssl::stream<>` is a library feature, not a language one.
```cpp
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
namespace asio = boost::asio;
namespace ssl = asio::ssl;
using tcp = asio::ip::tcp;
asio::awaitable<void> tls_client(asio::io_context& io) {
ssl::context ctx(ssl::context::tlsv13_client);
ctx.set_default_verify_paths();
ssl::stream<tcp::socket> stream(io, ctx);
// Connect underlying TCP socket
auto& sock = stream.lowest_layer();
co_await sock.async_connect(endpoint);
// Set SNI hostname (required for most servers)
SSL_set_tlsext_host_name(stream.native_handle(), "example.com");
stream.set_verify_mode(ssl::verify_peer);
stream.set_verify_callback(ssl::host_name_verification("example.com"));
// TLS handshake
co_await stream.async_handshake(ssl::stream_base::client);
// Read/write as normal stream
co_await async_write(stream, asio::buffer(request));
co_await async_read_until(stream, response_buf, "\r\n");
}
```
**Critical:** SSL streams require strand-based synchronization for all async operations — no concurrent reads/writes without a strand.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |