Problem Being Solved
What this service provides
Modern backend services are often built to handle plain-text HTTP traffic, leaving the complexity of TLS termination as an infrastructure concern. This page explains the core problem that tlsproxy solves: bridging the gap between encrypted client connections and plain-text backend services, so you can expose your services securely without modifying your application code.
The Challenge: TLS Everywhere, Not Always Easy
When you build a backend service, you typically want to focus on your application logic — not on managing TLS certificates, cipher suites, or handshake negotiation. Yet clients (browsers, mobile apps, other services) increasingly require or enforce encrypted connections. This creates a tension:
- Your backend speaks plain HTTP on a local port.
- Your clients require HTTPS (TLS-encrypted) connections.
- Embedding TLS directly into every service adds complexity, duplicates certificate management, and creates inconsistency.
What tlsproxy Does
tlsproxy sits between your clients and your backend services as a TLS termination proxy. It accepts incoming encrypted (TLS) connections from clients, decrypts them, and forwards the resulting plain-text traffic to your backend over a local, trusted network path. Responses from your backend travel the reverse route — tlsproxy re-encrypts them before delivering them to the client.
This means your backend service never needs to know about TLS at all. It simply receives and responds to plain HTTP requests, as if no encryption were involved.
Client ──(TLS/HTTPS)──► tlsproxy ──(HTTP)──► Your Backend Service
◄──(TLS/HTTPS)── ◄──(HTTP)──
Why This Matters to You
Separation of concerns. Your application code stays focused on business logic. Certificate management, TLS version policy, and cipher negotiation are handled in one place — the proxy — rather than scattered across every service you run.
Consistent security posture. Because TLS configuration lives in tlsproxy, you can update certificates or harden cipher settings once, and every service behind the proxy benefits immediately. You don't need to redeploy application code to rotate a certificate.
Local development and testing. Many developers need to test against HTTPS endpoints locally — for example, because a third-party OAuth provider requires a secure redirect URI, or because your browser enforces secure cookies. tlsproxy lets you run a real TLS endpoint locally without modifying your development server.
Compatibility with plain-text services. Legacy services, internal microservices, and simple development servers typically don't implement TLS. tlsproxy lets you add a secure, public-facing interface to any plain-text service without touching its source code.
What tlsproxy Is Not
tlsproxy is a focused TLS termination layer, not a full-featured reverse proxy or load balancer. It does not perform request routing based on URL paths, load balance across multiple backends, or cache responses. If you need those features, tlsproxy can be composed with other tools — but understanding its focused scope helps you use it correctly and set appropriate expectations.
Example: A plain-text development server exposed over HTTPS
Suppose you have a local backend API server running on http://localhost:8080. Without tlsproxy, any client that enforces HTTPS cannot connect to it. With tlsproxy configured to terminate TLS on port 8443 and forward to localhost:8080, your client connects securely:
# Client request (encrypted, sent to tlsproxy)
GET https://localhost:8443/api/users HTTP/1.1
Host: localhost:8443
tlsproxy decrypts the request and forwards it as plain HTTP:
# Forwarded request (plain-text, sent to your backend)
GET /api/users HTTP/1.1
Host: localhost:8080
Your backend responds normally:
# Backend response (plain-text)
HTTP/1.1 200 OK
Content-Type: application/json
{"users": [{"id": 1, "name": "Alice"}]}
tlsproxy re-encrypts the response and delivers it to the client:
# Client receives (encrypted)
HTTP/1.1 200 OK
Content-Type: application/json
{"users": [{"id": 1, "name": "Alice"}]}
From the client's perspective, it made a standard HTTPS request and received a standard response. Your backend never handled any TLS.
Example: Checking that the proxy is running
After starting tlsproxy, you can verify it is accepting connections using curl with the -k flag (to bypass certificate validation in local development):
curl -k https://localhost:8443/health
Expected output (forwarded from your backend's health endpoint):
HTTP/1.1 200 OK
- Configuration reference — Learn how to tell
tlsproxywhich port to listen on, where to forward traffic, and which TLS certificate to use for the use case. - Getting started — Step-by-step instructions for installing
tlsproxyand running it for the first time. - TLS certificates — Guidance on obtaining, configuring, and rotating the TLS certificates that
tlsproxypresents to clients. - Authentication and security — How to control which clients are permitted to connect through the proxy.
- Twisted framework — Background on the async networking framework that powers
tlsproxy, useful if you need to understand performance characteristics or extend the proxy's behavior.