← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Encryption in Transit

Cryptography Intermediate
debt(d7/e5/b5/t7)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). Tools listed — semgrep, ssllabs, owasp-zap — are specialist scanners that can catch some cases (e.g. CURLOPT_SSL_VERIFYPEER false, HTTP URLs in code), but internal service calls to MySQL, Redis, or message queues without TLS are often invisible without network-level inspection or careful code review. The gap between the external HTTPS surface and internal unencrypted connections is not caught by default linters, pushing this to d7.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix says to enforce HTTPS for all traffic AND between all internal services, verify CURLOPT_SSL_VERIFYPEER, and add mTLS for service-to-service communication. Common mistakes span MySQL connections, cURL calls, internal microservice HTTP, and HSTS headers — these touch multiple configuration files, connection setup code, infrastructure config, and deployment settings. Not a single-line patch, but not a full architectural rewrite either.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). Encryption in transit applies to web, API, and CLI contexts. Every new service connection, DB connection, queue consumer, and cURL call must be reviewed for TLS compliance. It doesn't rewrite-or-live-with-it, but it is a persistent cross-cutting concern that slows down every new integration point and requires ongoing vigilance across the codebase and infrastructure.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap — contradicts how a similar concept works elsewhere' (t7). The misconception is canonically stated: developers assume HTTPS means all traffic is encrypted, but it only covers the browser-to-server leg. Database connections, internal service calls, and message queue connections are frequently unencrypted despite HTTPS being present. This directly contradicts the reasonable mental model that 'my app is secure because it uses HTTPS,' making it a serious, well-documented trap.

About DEBT scoring →

Also Known As

TLS HTTPS mTLS in-transit encryption transport security

TL;DR

Encrypting data moving between systems using TLS — protecting against interception, tampering, and man-in-the-middle attacks on all network communication.

Explanation

Encryption in transit uses TLS (Transport Layer Security) to protect data between: browsers and web servers (HTTPS), services communicating internally (mTLS), application servers and databases, and message queues. HTTPS alone is insufficient if internal traffic is unencrypted — an attacker who compromises an internal network segment can intercept database credentials. Mutual TLS (mTLS) requires both parties to present certificates, eliminating the need for credentials in service-to-service communication.

Common Misconception

HTTPS means all traffic is encrypted — HTTPS encrypts the browser-to-server leg; database connections, internal service calls, and message queue connections are often unencrypted unless explicitly configured.

Why It Matters

A PHP application using HTTPS but connecting to MySQL over an unencrypted connection leaks database credentials and query results to anyone on the same network segment.

Common Mistakes

  • MySQL connection without SSL — credentials and all data in plaintext on the network.
  • CURLOPT_SSL_VERIFYPEER = false — disables certificate verification, enabling MITM.
  • Internal microservice communication over plain HTTP — encrypted external, unencrypted internal.
  • Not using HSTS — allows the first request to be downgraded from HTTPS to HTTP.

Code Examples

✗ Vulnerable
// Unverified TLS — MITM possible:
$ch = curl_init('https://payment-api.internal');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Never!

// MySQL without SSL:
$pdo = new PDO('mysql:host=db.internal', 'user', 'pass');
// Credentials and queries in plaintext
✓ Fixed
// Verified TLS:
$ch = curl_init('https://payment-api.internal');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);    // Default — keep it
curl_setopt($ch, CURLOPT_CAINFO, '/etc/ssl/certs/ca-certificates.crt');

// MySQL with TLS:
$pdo = new PDO(
    'mysql:host=db.internal;ssl_ca=/etc/ssl/mysql-ca.pem',
    'user', 'pass',
    [PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true]
);

// mTLS with client certificate:
curl_setopt($ch, CURLOPT_SSLCERT, '/certs/client.crt');
curl_setopt($ch, CURLOPT_SSLKEY,  '/certs/client.key');

Added 16 Mar 2026
Edited 22 Mar 2026
Views 63
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping W 2 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 1 ping S 2 pings S 3 pings M 0 pings T 0 pings W 0 pings T 0 pings F 2 pings S 0 pings S 1 ping M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 1 ping M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Perplexity 13 Amazonbot 9 Scrapy 6 SEMrush 5 ChatGPT 4 Ahrefs 4 Majestic 2 Unknown AI 2 Google 2 Claude 2 Meta AI 1 PetalBot 1
crawler 48 crawler_json 3
DEV INTEL Tools & Severity
🔴 Critical ⚙ Fix effort: Medium
⚡ Quick Fix
Enforce HTTPS for all traffic and between all internal services — use mTLS for service-to-service communication and verify CURLOPT_SSL_VERIFYPEER is never disabled in PHP
📦 Applies To
any web api cli
🔗 Prerequisites
🔍 Detection Hints
HTTP instead of HTTPS internal service calls; CURLOPT_SSL_VERIFYPEER false; PHP talking to Redis without TLS in production
Auto-detectable: ✓ Yes semgrep ssllabs owasp-zap
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Low ✓ Auto-fixable Fix: Low Context: File
CWE-319 CWE-311


✓ schema.org compliant