Skip to content

YemenJPT/YemenJPT-AI-Skills / skills/core/boost-asio-pro

boost-asio-pro

Verified

Use 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.

FileKindSize
README.ar.mdmarkdown4.3 KB
README.en.mdmarkdown2.9 KB
SKILL.mdskill md13.9 KB
references/build.mdmarkdown3.0 KB
references/classic-boost.mdmarkdown1.7 KB
references/coroutines.mdmarkdown16.1 KB
references/pre-cpp20.mdmarkdown8.2 KB
references/ssl.mdmarkdown1.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.

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 implementationStars: 323kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 323kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 323kUpdated Claude CodeCodexVerifiedInstall