---
title: "Hook the TLS boundary"
---

> Documentation Index
> Fetch the complete documentation index at: https://example.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hook the TLS boundary

A [uprobe](https://example.com/ebpf-field-guide/glossary/#uprobe) attaches an eBPF program to any user-space function entry; a [uretprobe](https://example.com/ebpf-field-guide/glossary/#uretprobe) fires when that function returns. By hooking `SSL_write` on entry, eBPF reads the outgoing plaintext buffer *before* encryption.

For incoming traffic, a uprobe saves the buffer pointer on `SSL_read` entry into a map keyed by thread ID, and the `uretprobe` copies the decrypted bytes on return—identical to how Pixie, Kubeshark, eCapture, and Beyla work.

## What changed

- SSL_write entry → copy plaintext before TLS encrypts
- SSL_read entry → stash buffer ptr by TID in BPF map
- SSL_read return → read N decrypted bytes into RingBuf

Source: https://example.com/ebpf-field-guide/networking-and-packet-path/tls-and-uprobes/uprobe/index.mdx
