Meituan-Dianping / lyrebird

移动应用插件化测试工作台
https://meituan-dianping.github.io/lyrebird/
MIT License
1.16k stars 246 forks source link

iOS获取图片失败 #203

Closed mengdg closed 5 years ago

mengdg commented 5 years ago

Describe the bug 公司的APP获取用户头像时,iOS系统9.3.1可以正常获取图片,11.4.1系统的iOS手机获取头像失败,提示的错误为: 10.0.15.62:56562: CONNECT alogs.umengcloud.com:443 << Cannot establish TLS with client (sni: alogs.umengcloud.com): TlsException("SSL handshake error: SysCallError(-1, 'Unexpected EOF')",)

To Reproduce Steps to reproduce the behavior:

  1. 登录Blued APP进入附近人页面 2.查看用户头像

Expected behavior 头像没有做任何mock,头像均可以正常加载

Smartphone (please complete the following information):

Additional context 10.0.15.90:51474: clientconnect 10.0.15.62:56560: CONNECT alogs.umeng.com:443 << Cannot establish TLS with client (sni: alogs.umeng.com): TlsException("SSL handshake error: SysCallError(-1, 'Unexpected EOF')",) 10.0.15.62:56560: clientdisconnect 10.0.15.62:56562: clientconnect 10.0.15.90:51474: POST https://alogs.umeng.com/app_logs << 200 OK 171b 10.0.15.62:56562: CONNECT alogs.umengcloud.com:443 << Cannot establish TLS with client (sni: alogs.umengcloud.com): TlsException("SSL handshake error: SysCallError(-1, 'Unexpected EOF')",) 10.0.15.62:56562: clientdisconnect 10.0.15.90:51477: clientconnect 10.0.15.90:51477: POST https://toblog.snssdk.com/service/2/app_log/ HTTP/2.0 << 200 91b

zhaoye commented 5 years ago

可能是证书的问题。 iOS10开始证书管理有些调整。之前直接安装证书并信任即可,但是在iOS10之后需要额外增加一步: 设置-->通用-->关于本机-->证书信任设置-->开启mitmproxy信任开关 @mengdg

mengdg commented 5 years ago

@zhaoye 问题已经解决了,非常感谢。

mengdg commented 5 years ago

10.0.15.62:60056: clientconnect 10.0.15.62:60055: CONNECT 106.75.61.80:443 << Certificate verification error for 106.75.61.80: hostname '106.75.61.80' doesn't match either of '.blued.cn', 'blued.cn' 10.0.15.62:60055: clientdisconnect 10.0.15.62:60056: CONNECT 106.75.64.130:443 << Certificate verification error for 106.75.64.130: hostname '106.75.64.130' doesn't match either of '.blued.cn', 'blued.cn' 10.0.15.62:60056: clientdisconnect 10.0.15.62:60057: clientconnect 10.0.15.62:60057: CONNECT init.itunes.apple.com:443

@zhaoye 能顺便问下这个问题嘛,我在请求APP内部分接口,会出现访问失败,是证书出了问题是吗?

zhaoye commented 5 years ago

这是client上的日志吗?看起来是有些证书的校验。 如果是的话,这个安全机制要关闭或者改到http协议才可以。 @mengdg

mengdg commented 5 years ago

这个是直接使用mitmdump会出现这个问题,使用Lyrebird没有遇到,还挺奇怪。我们有做什么特殊处理嘛?

zhaoye commented 5 years ago

如果是设置带方式接入的话。就是通过mitmproxy实现的。 一样的。