These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.

OpenSSL

@korulang/openssl@0.0.1

Client-side TLS for Koru, lifted from OpenSSL with verified-by-default connections and phantom free-chain obligations

openssl/index.kz · 6 tors

@koru/openssl — the definitive Koru client-TLS edition (scope v0) · 30 more lines
@koru/openssl — the definitive Koru client-TLS edition (scope v0) Wraps industry-standard OpenSSL (libssl/libcrypto) and lifts its most infamous footguns into Koru's type system: 1. VERIFIED BY DEFAULT. `connect` ALWAYS verifies the peer certificate AND the hostname. There is no knob to turn verification off. The only way to get an unverified channel is to type a *different, loudly named* event — `connect.insecure` — so a skipped-verification connection can never happen by omission. Decades of CVEs come from SSL_VERIFY_NONE and forgotten SSL_set1_host; here the safe path is the only unmarked path. 2. HANDSHAKE IS A PHANTOM STATE. `connect` performs the full handshake before it hands you an `open!` connection, so "read before handshake" is unrepresentable. `shutdown` transitions the connection out of the `open` state into `closing`, so "write after shutdown" does not compile. 3. THE FREE-CHAIN IS ONE PHANTOM OBLIGATION. SSL_free + SSL_CTX_free + closing the socket are the classic OpenSSL leak trio. Here they are a single `open!` obligation discharged by `close`. Forget it and the build fails (KORU030) — you cannot leak an SSL context. 4. THE ERROR QUEUE IS LIFTED. OpenSSL's ERR_get_error() drain-the-queue model becomes an honest `| err` branch on every fallible event, with the queue drained and the first diagnostic surfaced. Never silent. Grounded in the koru phantom-type suite: obligation threading follows sqlite3's `next`/`col.*` (consume `<!open>`, re-emit `<open!>`); the open! -> closing! -> discharge chain follows tests/regression/.../330_051 (`start-close` transition + `finalize` union `<!opened|closing>`).

Phantom lifecycles

Derived from the phantom labels in the declarations below — state! issues an obligation the compiler will chase, !state discharges it, a bare state holds it without moving it. Nothing here is hand-drawn.

Tls 2 states open!closing!

connect

<open!> index.kz:109

connect.insecure

<open!> index.kz:203

write

<!open><open!> index.kz:255

read

<!open><open!> index.kz:276

shutdown

<!open><closing!> index.kz:302

close

<!open|closing> index.kz:321