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

2021-12-28 11:26:11 +08:00
 neroxps

家里 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

客户端侧抓包如下:

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

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

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

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

758 次点击
所在节点    问与答
2 条回复
neroxps
2021-12-29 10:39:52 +08:00
emmm 所以没有人遇到??
neroxps
2022-04-09 20:56:41 +08:00
破案了 https://zhuanlan.zhihu.com/p/117365627

ros 不会自动切片,mss 是 1440 超出大小自动丢包了,导致 SSL 握手失败。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/824831

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX