V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
neroxps
V2EX  ›  问与答

家里 ipv6 访问 api.map.baidu.com ssl 握手失败,发出 Client hello 后收不到 Server hello

  •  
  •   neroxps · 2021-12-28 11:26:11 +08:00 · 752 次点击
    这是一个创建于 843 天前的主题,其中的信息可能已经有所发展或是发生改变。

    家里 ipv6 访问 api.map.baidu.com ssl 握手失败,发出 Client hello 后收不到 Server hellowww.taobao.com ipv6 没问题,一切正常。

    起因是最近在家里的 mikrotik hex BR750Gr3 配置了 ipv6 ,通过无状态地址分配 ipv6 ,然后老婆说家里 wifi 打开建行生活 APP 就显示定位失败,我抓包分析发现是 api.map.baidu.com ipv6 地址 SSL 握手失败,导致定位 API 无法连通,显示定位失败。老婆天天吐槽我花那么多钱搞的什么破 wifi (πーπ)( wifi 是申请买的 unifi )

    所以我就抓包分析了下

    curl 回显如下:

    $ curl -i -vvv https://api.map.baidu.com
    *   Trying 240e:ff:e020:3:0:ff:b0ce:15ad:443...
    * Connected to api.map.baidu.com (240e:ff:e020:3:0:ff:b0ce:15ad) port 443 (#0)
    * ALPN, offering h2
    * ALPN, offering http/1.1
    * successfully set certificate verify locations:
    *  CAfile: /etc/ssl/certs/ca-certificates.crt
    *  CApath: /etc/ssl/certs
    * TLSv1.3 (OUT), TLS handshake, Client hello (1):
    * OpenSSL SSL_connect: Connection reset by peer in connection to api.map.baidu.com:443 
    * Closing connection 0
    curl: (35) OpenSSL SSL_connect: Connection reset by peer in connection to api.map.baidu.com:443 
    

    TCPing 80 端口一切正常

    $ tcping -c5 -H api.map.baidu.com
    Ping http://api.map.baidu.com:80([240e:ff:e020:3:0:ff:b0ce:15ad]:80) - http is open - time=106.713939ms method=GET status=200 bytes=0
    Ping http://api.map.baidu.com:80([240e:ff:e020:3:0:ff:b0ce:15ad]:80) - http is open - time=61.98791ms method=GET status=200 bytes=0
    Ping http://api.map.baidu.com:80([240e:ff:e020:3:0:ff:b0ce:15ad]:80) - http is open - time=66.884024ms method=GET status=200 bytes=0
    Ping http://api.map.baidu.com:80([240e:ff:e020:3:0:ff:b0ce:15ad]:80) - http is open - time=72.943282ms method=GET status=200 bytes=0
    Ping http://api.map.baidu.com:80([240e:ff:e020:3:0:ff:b0ce:15ad]:80) - http is open - time=59.91197ms method=GET status=200 bytes=0
    
    Ping statistics http://api.map.baidu.com:80
            5 probes sent.
            5 successful, 0 failed.
    Approximate trip times:
            Minimum = 59.91197ms, Maximum = 106.713939ms, Average = 73.688225ms
    

    客户端侧抓包如下:

    Snipaste_2021-12-28_11-06-24.png

    但手机切换到 4G 又好了,按道理 api.map.baidu.com 支持 ipv6 的话,4G 也会访问 ipv6 ,如果是百度问题,那么 4G 的 ipv6 不应该正常。我又在公司的 ipv6 测试,结果一切正常。

    后来我让群里网友帮我测试了下,南昌移动 ipv6 结果一样,SSL 收不到 Server hello ,ipv4 一切正常。www.taobao.com 的 ipv6 也是一切正常。

    那么问题出在哪里??想不懂。

    抓包分析得出就是服务器发过来的 Server hello 客户端那边收不完整。所以到底是运营商的锅?还是百度地图 api 运维的锅???

    neroxps
        1
    neroxps  
    OP
       2021-12-29 10:39:52 +08:00
    emmm 所以没有人遇到??
    neroxps
        2
    neroxps  
    OP
       2022-04-09 20:56:41 +08:00
    破案了 https://zhuanlan.zhihu.com/p/117365627

    ros 不会自动切片,mss 是 1440 超出大小自动丢包了,导致 SSL 握手失败。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1007 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:58 · PVG 02:58 · LAX 11:58 · JFK 14:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.