今日已更新 298 条资讯 | 累计 42709 条内容
关于我们

Ping Works, but HTTPS Doesn't: How to Find What Actually Broke

Michael Placzek 2026年09月13日 21:00 1 次阅读 来源:Dev.to

You've probably seen this before: $ ping example.com 64 bytes from 93.184.216.34: icmp_seq=1 ttl=54 time=18 ms 64 bytes from 93.184.216.34: icmp_seq=2 ttl=54 time=17 ms So the network works, right? Then: $ curl https://example.com curl: (28) Connection timed out Or your browser spins forever. This is one of the most common traps in network troubleshooting: treating a successful ping as proof that "the network is fine." It isn't. ping answers one fairly narrow question. Your application depends on several other things succeeding after that. What ping actually proves Ping normally uses ICMP echo requests and replies. If a host responds, you've learned something useful: your machine has some working route toward the destination packets can travel across at least part of that path the destination, or something representing it, is responding to ICMP But an HTTPS connection needs much more. A simplified path looks something like this: Network interface | Routing | DNS | TCP connection | TLS handshake | HTTP | Application And real networks can add more: Proxy VPN Firewall NAT MTU problems IPv4 / IPv6 differences A successful ICMP echo doesn't prove all of those layers work. That's why "but I can ping it" often doesn't get you very far. DNS can still be the problem There are a few variations here. Suppose you run: ping 1.1.1.1 and it works. That says nothing about DNS. Try: dig example.com or: getent ahosts example.com If name resolution fails, applications using hostnames will still be broken even though you have basic IP connectivity. There's another wrinkle: your application and your diagnostic tool may not necessarily use DNS in exactly the same way. Your system resolver, a browser using encrypted DNS, a VPN-provided resolver, and a corporate DNS setup can produce different behavior. So "DNS works" can sometimes need a more specific question: Which DNS, resolving what name, from which environment? TCP can fail even when ping succeeds HTTPS normally needs a TCP connectio

本文内容来源于互联网,版权归原作者所有
查看原文