curl and openssl Flow Through Corporate Proxy with SSL Inspection
What is Corporate Proxy with SSL Inspection? Corporate proxies intercept HTTPS traffic to inspect content for security and compliance. This is called SSL Inspection or MITM (Man-In-The-Middle). Complete Flow: curl Through Proxy Command: curl -v -x http://proxy.company.com:8080 https://api.example.com/data Step-by-Step Flow: 1. DNS Resolution curl resolves proxy hostname ↓ DNS: proxy.company.com → 192.168.1.100 2. TCP Connection to Proxy curl → proxy:8080 ↓ TCP handshake: SYN, SYN-ACK, ACK ↓ Connection established 3. CONNECT Request (HTTP Tunnel) curl sends: → CONNECT api.example.com:443 HTTP/1.1 → Host: api.example.com → User-Agent: curl/8.0.0 → Proxy-Connection: Keep-Alive Proxy responds: ← HTTP/1.1 200 Connection established Key point: CONNECT doesn’t create new TCP connection - it repurposes existing connection as tunnel. ...
