handm
V2EX  ›  Web Dev

求助:通过 http 访问某域名失败

  •  
  •   handm · Jul 10, 2024 · 3474 views
    This topic created in 852 days ago, the information mentioned may be changed or developed.
    背景:最近接手了公司的一个项目,用 delphi 写的,通过 http 访问公司的云服务。
    1.偶尔有用户反馈有问题,排查后发现是访问公司的云服务失败了(报错:与服务器的连接意外终止),但是可以 ping 通,怀疑是 delphi 中 http 组件的问题
    2.于是用 C#写了一个测试程序,通过 http 访问相同的云服务,也失败了(报错:The underlying connection was closed: An unexpected error occurred on a receive.)
    3.在有问题的电脑上访问其他域名都正常,访问公司的域名都不正常,不知道和什么东西有关
    有没有大佬帮忙分析一下
    6 replies  •  2024-07-11 11:59:41 +08:00
    rekulas
    rekulas
    Jul 10, 2024
    1
    考虑下是不是防火墙原因导致?
    先排除语言问题,直接 curl 测试访问是否正常
    然后换 ip 不换域名试试连接是否被拦截例如 curl -H "host: yourdomain.com" 其他 vpsip
    一步步排查原因
    0o0o0o0
    0o0o0o0
    Jul 10, 2024
    2
    ping 走的是 icmp ,http 走的 tcp ,用 tcping 看看
    wu00
    wu00
    Jul 10, 2024
    3
    随手一搜这么多说 tls 问题的,排除了吗
    adrianzhang
    adrianzhang
    Jul 10, 2024
    4
    抓包看吧。
    yurang
    yurang
    Jul 10, 2024
    5
    客户端和服务器端同时 wireshark 抓包,逐包对比
    nevermoreluo
    nevermoreluo
    Jul 11, 2024
    6
    排查一下 https 吧 有遇到过证书不对导致,浏览器访问正常但是代码或者 curl 一直报错的情况。
    提供一些思路,能复现的话可以简单用 curl -vvv 先看看报文卡在哪一步了,再进一步排查
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1014 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 61ms · UTC 18:39 · PVG 02:39 · LAX 10:39 · JFK 13:39
    ♥ Do have faith in what you're doing.