Secure TLS Client–Server — encrypted messaging, file transfer & live monitoring
A multi-client messaging system where every byte on the wire is encrypted with TLS, every message is framed so binary files can't be confused with text or message boundaries, and a Streamlit dashboard watches connections, heartbeats, and logs in real time without ever blocking the server.
30-second version
I built a multi-client secure messaging system in Python: every connection is wrapped in TLS with server and client certificates, so traffic is encrypted and the peers are authenticated before a single application byte moves. On top of that I added length-prefixed framing so you can send text or raw binary files safely, private and broadcast routing, heartbeat-based dead-connection detection, and a Streamlit dashboard that shows live connection status and logs.
2-minute version
The server accepts concurrent TLS connections and keeps a registry of every authenticated client. Each
client runs on its own thread so a slow sender can't stall everyone else, and a shared queue carries
events to the dashboard. Messages are framed with a 4-byte length prefix plus a type byte, which is
what lets the same channel carry JSON text and arbitrary file bytes without the two ever colliding.
Heartbeats are a simple PING/PONG: if a peer is silent longer than a configurable timeout, the server
drops it and tells everyone else. The hard part wasn't the crypto — the ssl module does the
handshake — it was the trust model (self-signed vs. CA-issued certs), the framing, and the concurrency
trade-offs. The dashboard reads server state through a queue, never the accept loop, so monitoring can
never block traffic.
01 Overview
This project is a small but complete secure communication system: a TLS server that many clients can connect to at once, exchange private or broadcast messages, transfer files, and stay visible on a monitoring dashboard. It exists because most "chat server" tutorials hand-wave the security layer — they send plaintext over a bare socket and call it done. I wanted to build the thing where the security is the point, not an afterthought.
The result is a system in three moving parts: a TLS server that authenticates clients and routes traffic, a set of clients that connect, chat, and transfer files, and a Streamlit dashboard that observes connection state and logs. Everything on the wire is encrypted; everything at the application layer is framed so that message boundaries are unambiguous even when the payload is raw binary.
This is a networking and security interview artifact in one. It exercises the full stack a backend engineer gets asked about: how TLS actually works under the hood, how certificates prove identity, how to do concurrency on sockets, how to frame binary data, how to detect dead peers, and how to observe a running server without disturbing it. Each of those is a question someone will ask, and each maps to a real decision I made here.
02 Problem & Context
The concrete problem is simple to state: move arbitrary data — text and files — between many machines, securely, and keep it observable. "Securely" unpacks into three separate guarantees that a bare TCP socket gives you none of:
- Confidentiality — a third party watching the network must not be able to read the traffic.
- Integrity — nobody must be able to tamper with a message in transit without detection.
- Authentication — the client must know it's talking to the real server, and the server must know which client it's talking to.
TCP alone is a stream of bytes: it guarantees order and delivery, but nothing about secrecy or identity. Everything above that — the encryption, the identity checks, and even the notion of "where one message ends and the next begins" — is a layer the application has to build. On top of that there are three engineering constraints that shaped the design:
Many clients at once
The server must not serialize on one slow client. Concurrency is a first-class requirement, not a nice-to-have.
Binary-safe by construction
Files can contain any byte, including the ones that look like message delimiters. Framing must not rely on reserved characters.
Dead peers must be found
A crashed client or a dropped link shouldn't leave a ghost entry in the registry forever. Liveness needs an explicit signal.
Observability without coupling
The dashboard must see what's happening without the monitoring path ever becoming a choke point on the data path.
03 Foundations
These are the concepts the whole project stands on, explained the way I'd explain them to a smart non-expert — because that's exactly how an interviewer will ask you to explain them.
TLS — the security layer over TCP
Transport Layer Security sits between TCP and your application. It does a handshake to agree on keys, then encrypts every following byte. It gives confidentiality, integrity, and (via certificates) authentication.
X.509 certificates — machine identity cards
A certificate binds a public key to a name (and other fields) and is signed by someone you trust. Verification means checking that signature chain, the validity dates, and the hostname.
Certificate authorities vs. self-signed
A CA is a trusted third party that vouches for keys. A self-signed cert is one the server vouches for itself — cryptographically fine, but there's no third party backing the claim of identity.
Symmetric vs. asymmetric cryptography
Symmetric uses one shared key (fast, good for bulk data). Asymmetric uses a public/private pair (slow, good for agreeing on that shared key and for signing). TLS uses both: asymmetric to bootstrap, symmetric for the actual traffic.
Sockets — the OS endpoint
A socket is the OS handle for one end of a TCP connection. The server listens on one socket and, for each new connection, gets a new connected socket to talk to that specific client.
Concurrency — threads vs. selectors
Threads give each client its own call stack (simple mental model, real per-connection memory). select/selectors let one thread watch many sockets and react only to the ready ones (scales better, harder to read).
Framing — where one message ends
TCP is a byte stream, not a message stream. "Framing" is the rule that lets both ends reconstruct discrete messages from that stream — here, a length prefix rather than a delimiter character.
Heartbeats — proof of life
Periodic small messages exchanged when there's nothing else to say. If none arrive within a timeout, the peer is presumed dead and the connection is torn down.
04 Architecture
One server process owns everything on the server side. Its accept loop hands each new TLS connection to a thread that reads framed messages, updates a shared connection registry, and routes payloads. A certificate (self-signed, or CA-signed in the "production-shaped" mode) authenticates the server to clients. A queue carries state-change events to the dashboard process, which renders them without ever touching the socket loop.
| Component | Responsibility | Key mechanism |
|---|---|---|
| TLS server | Accept connections, authenticate peers, route framed messages | ssl.SSLContext + wrap_socket |
| Connection registry | Track every live client by id | dict guarded by a threading.Lock |
| Message router | Deliver private vs. broadcast messages | type byte + target id in frame header |
| File-transfer module | Move raw bytes without corruption | length-prefixed binary frames, no text encoding |
| Heartbeat monitor | Detect dead or silent peers | PING/PONG with an idle timeout |
| Streamlit dashboard | Visualize state and logs, trigger controls | shared queue.Queue of events |
05 Execution / Data Flow
The life of a session has two phases: the handshake (who are you, and let's agree on keys) and the session (framed application traffic, heartbeats, and an orderly close). The diagram below shows a client→server sequence; the "broadcast" arrow shows the server fanning a message out to the other connected clients.
- TCP connect. The client opens a TCP connection; the server's accept loop returns a new socket for this peer.
- Wrap with TLS. Both ends hand the raw socket to
ssl.SSLContext.wrap_socket. The handshake runs automatically. - Authenticate. The client verifies the server certificate (chain, hostname, dates). If mutual TLS is enabled, the server verifies the client cert too.
- Register. The server adds the client to the shared registry and emits a "connected" event to the dashboard queue.
- Exchange frames. The client thread reads length-prefixed frames, dispatches by type byte to the router, and writes replies back on the same socket.
- Route. Private messages go to one target id; broadcasts fan out to every other registered client.
- Monitor. While idle, PING/PONG heartbeats flow. Silence past the timeout marks the peer dead and triggers cleanup plus a dashboard event.
- Close. The client sends
close_notify, the server removes it from the registry, and the socket is shut down cleanly.
06 Key Design Decisions & Trade-offs
| Decision | Chosen approach | Alternative rejected | Why / trade-off |
|---|---|---|---|
| Concurrency model | Thread-per-client | selectors / asyncio event loop | Threads make per-client blocking reads trivial to reason about; the trade-off is real per-thread memory and context-switch cost, which only bites at hundreds/thousands of clients — I documented selectors as the scale path. |
| Framing | Length-prefixed (4-byte big-endian) + type byte | Delimiter (e.g. newline) or newline-separated JSON | A length prefix can't appear "by accident" inside a file; a delimiter can. Length-prefix is also cheaper to parse (one struct.unpack vs. scanning for a byte). |
| Server identity | Self-signed cert (dev) → CA-issued (prod-shaped) | Self-signed everywhere, clients skip verification | Skipping verification trains a bad habit and opens a MITM hole. I kept verification on, and pinned/shipped the CA explicitly so the trust model stays honest. |
| Client auth | TLS server auth + app-layer identity | Mutual TLS (client certs) only | mTLS authenticates machines, not users. I separated transport trust from application identity so I could talk about both layers cleanly. |
| Dashboard integration | Shared queue.Queue + poll loop | Dashboard calling server internals directly | The queue decouples monitoring from the data path; the dashboard can lag or even crash without stalling message routing. |
| Liveness | Application PING/PONG heartbeat | Rely on TCP keepalive alone | TCP keepalive's default is far too slow (hours); an app-level heartbeat gives a tunable, sub-minute failure detection window. |
Thread-per-client vs. selectors is the classic fork. Threads won here because this is a
teaching-grade system with tens of clients, where a blocking recv per thread is the simplest
correct code. If I were headed to thousands of concurrent connections, I'd switch to a selector/async
model — one event loop, no per-client stack — and accept the harder control flow. I can defend both, and
I can name the crossover point: threads win on clarity, selectors win on memory and scheduling overhead
once connection count is high and most connections are idle.
07 Challenges & How I Solved Them
Files arrived truncated or glued to the next message
Symptom: a transferred file sometimes ended early, or its tail got merged with the following chat message. Root cause: the receiver treated recv as returning one message, but TCP can return a partial read — a 1 MB file arrives as many chunks, and the next logical message may already be in the same buffer. Fix: a real framing layer that loops recv until it has accumulated exactly the length prefix promised, then parses the next header from the remainder.
Non-ASCII text corrupted during file transfer
Symptom: binary bytes were being decoded as UTF-8 and re-encoded, mangling them. Root cause: one code path read everything through a text decoder. Fix: files stay as raw bytes end to end — read as bytes, framed as bytes, written as bytes. Text is encoded/decoded only at the chat boundary, never in the file path.
Ghost clients lingered after a crash
Symptom: a client that crashed without closing still showed as connected, and messages routed to it were silently lost. Root cause: there was no liveness signal, so a dead socket looked identical to a quiet one. Fix: PING/PONG heartbeats plus an idle timeout; a peer that misses its window is dropped and the registry is cleaned.
Dashboard reading state would stall the server
Symptom: polling server internals from the dashboard caused pauses under load. Root cause: monitoring and the data path shared state directly. Fix: the server publishes events to a queue.Queue; the dashboard only drains that queue, so monitoring and routing are fully decoupled.
08 Interview Q&A
Walk me through the TLS handshake, step by step, and what each step actually achieves.
I'll describe the common flow and note where 1.3 differs. First the client opens TCP — that's just transport, no security yet. Then the ClientHello: the client says which TLS versions and cipher suites it supports, plus a random nonce. The ServerHello picks a version and a cipher suite and sends its own nonce. The server then sends its certificate — the X.509 chain — and (in TLS 1.2) a key-exchange message. The client verifies the certificate: signature chain up to a trusted root, validity dates, and hostname. Then key exchange: both sides agree on a shared secret — in modern TLS this is ephemeral Diffie–Hellman (ECDHE), which also gives forward secrecy. From that shared secret both derive the symmetric session keys. The Finished message is the first thing encrypted under those keys and proves both sides derived the same secret — it's the "tamper-evident seal" on everything so far. After Finished, application data flows encrypted.
Each step earns one specific property: ClientHello/ServerHello agree on parameters, the certificate delivers authentication, key exchange delivers a shared secret without ever sending it, and Finished confirms integrity. TLS 1.3 folds several of these into one round trip and drops the old RSA key-exchange modes, which is why a 1.3 handshake is noticeably faster.
Why does TLS use both symmetric and asymmetric cryptography? Can't one do both jobs?
They solve different problems with different cost profiles. Asymmetric crypto (like ECDHE or RSA) is how two strangers agree on a secret over an untrusted channel — that's the hard problem — but it's thousands of times slower than symmetric. Symmetric crypto (like AES-GCM or ChaCha20-Poly1305) is fast and fine for bulk data, but it needs both sides to already hold the same key. TLS uses asymmetric crypto once, during the handshake, to bootstrap a shared secret, then switches to a symmetric session key for the actual payload. You get the security of public-key agreement with the speed of symmetric encryption.
What exactly does a certificate prove, and how does verification work?
A certificate proves one narrow thing: that a given public key belongs to a given identity (a hostname or organization), according to whoever signed it. Verification is a chain of signatures. The leaf cert is signed by an intermediate CA, the intermediate by a root CA, and the root is a key your system already trusts because it ships in the OS/browser trust store. Verification walks that chain checking each signature, then checks three more things: the cert isn't expired and is currently valid, and the hostname you connected to matches the cert's Subject Alternative Name. If any link fails, the connection is refused.
Self-signed vs. CA-issued certificates — what's the real trade-off, and which did you use?
Cryptographically they're identical — a self-signed cert uses the same signature math. The difference is purely trust: a CA-issued cert is vouched for by a third party your client already trusts, so verification "just works." A self-signed cert vouches for itself, so there's no third party to check — the client has to be told "this exact cert is okay" out of band, or it will reject the connection. In this project I used self-signed certs for development (generated with openssl or the ssl module) and kept verification on by shipping the cert to clients explicitly rather than disabling checks. That's the honest middle ground: no third-party CA dependency, but also no "just skip verification" hole that a MITM could walk through.
Why TCP sockets? And how do you handle multiple clients — threads vs. selectors — and what's the trade-off?
TCP because the application needs ordered, reliable, in-order delivery — chat and file transfer break if bytes arrive out of order or are dropped. That reliability is exactly what TCP buys over raw UDP. For concurrency, I used thread-per-client: the accept loop spawns one thread per connection, and each thread does a blocking read on its own socket. That's the simplest correct model — each client's logic is a straight-line read→dispatch→write loop. The trade-off is memory and scheduling: every thread has a stack and the OS context-switches between them. select/selectors (or asyncio) instead lets one thread watch many sockets and react only to ready ones — far better at thousands of mostly-idle connections, but the control flow is harder to read and a slow handler can stall the loop. My rule of thumb: threads for clarity at low-to-mid connection counts, selectors when you're scaling to many idle connections.
How do you frame messages so binary file data isn't confused with text or message boundaries?
The insight is that TCP is a byte stream, not a message stream — it has no idea where one message ends and the next begins. A delimiter (like a newline) works for text until a file contains that exact byte, and then it corrupts. So I used length-prefixed framing: every frame is [4-byte length][1-byte type][payload]. The receiver reads exactly 4 bytes, unpacks the length (struct.unpack("!I", …)), then reads exactly that many payload bytes — looping recv until it has them all, because one recv may return a partial chunk. The length prefix is self-describing: whatever the payload bytes are, the receiver knows their count from the header, so a file byte can never be mistaken for a boundary or a text character.
How does binary-safe transfer actually avoid encoding corruption?
By never passing file bytes through a text codec. The whole file path treats the payload as raw bytes: read from disk as bytes, framed as bytes (length prefix + raw payload), sent over the TLS socket as bytes, and written to disk as bytes. Encoding only ever happens at the chat-text boundary, where it belongs. The classic corruption bug is reading binary into a str, decoding it as UTF-8, then re-encoding — that's lossy for arbitrary bytes. Keeping files as bytes end to end makes the transfer lossless by construction.
How do private vs. broadcast routing work?
The frame header carries a type byte and, for private messages, a target id. When a frame arrives, the router looks at the type: private means look up the target id in the connection registry and deliver only there; broadcast means iterate every other registered client and deliver to each. The registry — a dictionary mapping client id to socket, guarded by a lock — is what makes routing O(1) for private messages and a simple fan-out for broadcast. If a target isn't in the registry, the router either buffers or drops the message and logs it, so a send to a dead peer fails loudly rather than silently.
How do heartbeats detect a dead connection, and how do you choose the timeout?
When a connection is idle, the peers exchange tiny PING/PONG frames on a fixed interval. If the server hasn't heard from a client within the timeout window, it declares the peer dead, removes it from the registry, and broadcasts the departure. The timeout is a tuning decision: too short and you drop healthy clients on a transient network hiccup or a slow machine; too long and dead connections linger, wasting registry slots and routing messages into the void. A common starting point is a heartbeat interval of ~10–30s with a timeout of 2–3 missed beats (so ~30–60s to detection). I'd label that an estimate — the right number depends on the real network's latency and jitter, and it's the kind of thing you tune against measured false-positive rate.
What is a MITM attack, and why does TLS prevent it?
A man-in-the-middle sits between client and server, relaying traffic so each side thinks it's talking directly to the other while the attacker reads or tampers with everything. TLS defeats this with authentication: the server presents a certificate that chains to a root the client already trusts, and the client verifies it before sending anything sensitive. A MITM can't forge that certificate without the CA's private key, and a self-signed impostor cert simply fails verification. The symmetric session key is then derived during the handshake in a way that never sends the secret across the wire, so even if the attacker records everything, they can't decrypt it. The one caveat: this only works if the client actually enforces verification — which is exactly why I never shipped a "skip verification" mode.
How would you prevent replay or spoofing inside the application layer?
TLS prevents replay at the record layer (sequence numbers and, in 1.3, per-record keys make old records un-replayable), but replay of application-level commands is a separate concern. To stop someone from re-sending a captured "transfer money"-style command, I'd add a monotonically increasing message sequence number per connection and reject any message whose sequence isn't exactly the next expected one, plus a server-assigned session nonce so a recorded message from one session can't be replayed into another. For spoofing at the app layer — one client claiming to be another — the fix is to tie identity to what TLS already authenticated (the verified peer certificate or the authenticated session), not to a self-reported username. In short: TLS authenticates the channel; the app must still authenticate the actor and reject out-of-order or repeated commands.
How does the Streamlit dashboard read server state without blocking the server?
By decoupling the two with a queue. The server never gives the dashboard direct access to its sockets or registry. Instead, every state change — connect, disconnect, message, heartbeat timeout — is pushed as an event onto a thread-safe queue.Queue. The dashboard side drains that queue into its own lightweight state (or st.session_state) and re-renders on a refresh interval. Streamlit re-runs the script top-to-bottom on interaction, so the live-update path is a poll loop, not a callback into the server. The key property: the dashboard can be slow, lag, or even crash, and the message path keeps running — monitoring is a reader, never a participant in the hot loop.
How would you test the security and the concurrency of this system?
Three layers. Security: negative tests — assert the client rejects an expired cert, a wrong-hostname cert, a tampered cert, and a cert not in the trust store; assert that a passive packet capture contains no plaintext. Concurrency: spin up many clients in parallel threads and verify ordering and isolation — private messages land only on the right socket, broadcasts reach everyone, no interleaving corrupts frames, and a slow client doesn't stall a fast one. Failure injection: kill clients abruptly (no close_notify), drop connections mid-file-transfer, and confirm the heartbeat path cleans up the registry and the file transfer either completes or fails without corrupting partial state. I'd write these as small scripts or pytest cases driving real sockets on localhost, with TLS enabled — testing the actual encrypted path, not a mocked one.
What breaks when you push this to 10× the clients — and how would you fix it?
The first thing to break is the thread-per-client model: thousands of threads means thousands of stacks and real context-switch overhead, plus the GIL limits CPU-bound Python to one thread at a time (though socket I/O releases the GIL, so it's not catastrophic). The fix is to move to an event loop — selectors or asyncio — where one thread multiplexes all connections. The second thing is the broadcast path: a naive fan-out becomes O(n) per message and O(n²) under heavy broadcast; you'd shard clients or use a pub/sub broker (Redis pub/sub or NATS) so the server isn't the single fan-out point. The third is the in-memory registry and queue: they're single-process, so you can't scale horizontally — you'd move state to a shared store and the event queue to a real broker. TLS itself scales fine; it's the surrounding architecture that needs to change.
Why does TLS alone not give you authentication of application users?
This is the tricky one, and it's a trap people fall into. TLS authenticates endpoints — it proves the client is talking to the real server, and (with mutual TLS) that the client holds a valid certificate. But a certificate is a property of a machine or a key, not of a person. It says nothing about which user is sitting at that machine, whether that user is authorized to perform a given action, or whether their credentials are still valid. A stolen laptop with a valid client cert would authenticate perfectly at the TLS layer. Application-user authentication — usernames, passwords, sessions, roles, permissions — is a separate layer that must run on top of TLS. So the honest framing is: TLS gives you a secure, authenticated channel; it does not give you identity of the human using it.
How does TLS 1.3 differ from 1.2, and does it matter for this project?
Three differences worth knowing. First, latency: 1.3 completes the handshake in one round trip (and allows 0-RTT resumption), because the client sends its key share in the ClientHello — 1.2 needs two round trips. Second, cryptography: 1.3 removed the old RSA key-exchange and weaker ciphers, so everything uses forward-secret ephemeral Diffie–Hellman and AEAD ciphers. Third, encrypted handshake: 1.3 encrypts the certificate and much of the handshake itself, closing an information leak 1.2 had. For this project it matters in two ways: the ssl module lets me pick the version, so I can demonstrate the difference, and 1.3's forward secrecy is a nice concrete answer to "what happens if the server key leaks later?" — past sessions stay unreadable.
09 Limitations & If I Rebuilt It
- Single process, in-memory state. The registry and event queue live in one process, so the system can't scale horizontally or survive a server restart without losing connection state. A v2 would move state to a shared store and events to a broker.
- Thread-per-client ceiling. Fine for tens of clients, but it's the wrong model for thousands. I'd start with
asyncioorselectorsfrom the beginning if I expected scale. - No application-layer auth. The project deliberately separates TLS (endpoint trust) from user identity, but it means the app layer doesn't yet do real users/roles/sessions.
- No replay protection at the app layer. I know the sequence-number/nonce design, but it isn't implemented yet — it's the clearest next hardening step.
- Self-signed trust bootstrap is manual. Shipping certs to clients out-of-band works for a demo but doesn't rotate or revoke cleanly. A v2 would add proper CA tooling and certificate rotation.
I'd keep the framing and the queue-decoupled dashboard exactly as they are — those decisions held up.
I'd change the concurrency model to asyncio, add application-layer authentication (users,
sessions, permissions) on top of TLS, add message sequence numbers for replay protection, and switch the
transport to mutual TLS so both directions are authenticated at the transport layer. Those are the four
changes that take it from "secure demo" to "defensible production shape."
10 Talking Points & Metrics
Crisp talking points to lead with:
- "I didn't just wrap a socket in TLS — I built the framing, the trust model, and the liveness layer around it." That's the sentence that signals depth beyond a tutorial.
- "Length-prefixed framing is what makes text and binary files share one channel safely." Concrete, testable, and it preempts the delimiter-corruption trap.
- "Monitoring reads through a queue, never the socket loop." Shows you think about observability as a non-blocking concern.
- "TLS authenticates the channel; the app still has to authenticate the user." The exact distinction that separates engineers who understand security from those who recite it.
- "Thread-per-client for clarity, selectors for scale — I can name the crossover." Signals you choose concurrency models deliberately, not by default.
11 Project Glossary
- TLS
- Transport Layer Security — the protocol that encrypts and authenticates traffic over TCP, via a handshake that agrees on session keys.
- X.509 certificate
- The standard format for a public-key certificate — a signed statement binding a key to an identity, valid for a time window.
- Certificate Authority (CA)
- A trusted third party that signs certificates; its root key lives in your OS/browser trust store.
- Self-signed certificate
- A certificate signed by its own key rather than a CA — cryptographically valid but with no third-party trust backing.
- Symmetric key
- A single shared key used to both encrypt and decrypt; fast, used for the bulk TLS session traffic.
- Asymmetric (public-key) crypto
- A public/private key pair used for key agreement and signatures; slow, used only to bootstrap the symmetric key.
- Handshake
- The initial phase where peers authenticate and derive session keys before any application data flows.
- Framing
- The rule for carving discrete messages out of a continuous byte stream — here, a length prefix plus a type byte.
- Heartbeat
- A periodic PING/PONG exchanged when idle, so a dead peer is detected within a known timeout.
- Man-in-the-middle (MITM)
- An attacker relaying traffic between two parties; TLS prevents it via certificate authentication.
- selectors / select
- OS primitives that let one thread monitor many sockets and react only to the ready ones — the scale alternative to threads.
- Streamlit
- A Python framework for building data dashboards quickly; here it renders connection state and logs from a queue.
- close_notify
- The TLS message that signals an orderly end to a session, distinguishing a clean close from a truncation attack.
12 References
- RFC 8446 — The Transport Layer Security (TLS) Protocol Version 1.3 · rfc-editor.org/rfc/rfc8446
- RFC 5246 — The Transport Layer Security (TLS) Protocol Version 1.2 · rfc-editor.org/rfc/rfc5246
- RFC 5280 — Internet X.509 Public Key Infrastructure Certificate and CRL Profile · rfc-editor.org/rfc/rfc5280
- Python
ssl— TLS/SSL wrapper for socket objects · docs.python.org/3/library/ssl.html - Python
socket— low-level networking interface · docs.python.org/3/library/socket.html - Python
selectors— high-level I/O multiplexing · docs.python.org/3/library/selectors.html - Python
threading— thread-based parallelism · docs.python.org/3/library/threading.html - Streamlit documentation · docs.streamlit.io
- OpenSSL documentation · openssl.org/docs