xyuanmu / XX-Mini

:ghost: XX-Net 精简版
445 stars 126 forks source link

【证书问题】iOS证书导入后仍然报ssl error,求解 #134

Closed doyard closed 6 years ago

doyard commented 6 years ago

提问之前

  1. clone最新版本的xx-mini,checkout到v1.3.1 scp 到/opt/usr目录
  2. 安装好各种依赖,配置了manal.ini listen和pac enable后配置为0.0.0.0 正常启动了,扫描出了很多ip
  3. 手机连上wifi之后,配置auto proxy url 为 http://192.168.123.1:8086/proxy.pac (经验证,配置为http://192.168.1.45:8086/proxy.pac 效果一样)
  4. 手机连接Google等https网站会有ssl error,按网上的说明,把data目录下CA.crt scp到我本地,发附件邮件到iOS设备上正常安装,显示 verified
  5. 再次 打开google,弹出警告信息,点 continue 和点 detail (点进去右上角有 trust )之后,日志仍然显示ssl error 6.已尝试重新clone项目,也尝试重新生成证书和保持CA.crt不变,删掉certs目录.仍然是这个问题

问题内容

iOS设备访问https网站 会显示 ssl error,不是很懂openSSL库相关的证书问题,希望有朋友帮忙诊断一下问题

附加内容

XX-Mini Version : 1.3.1 (python/2.7.13 pyopenssl/16.1.0) Listen Address : 192.168.1.45:8087 Setting File : manual.ini/proxy.ini GAE APPID : Using Public APPID Pac Server : http://192.168.1.45:8086/proxy.pac CA File : http://192.168.1.45:8086/CA.crt Pac File : file:///opt/usr/XX-Mini/data/proxy.pac

Jul 27 20:41:05.282 - [INFO] SSL use version:TLSv1_2 Jul 27 20:41:05.291 - [INFO] OpenSSL support alpn Jul 27 20:41:05.475 - [INFO] load ip range file:/opt/usr/XX-Mini/ip_range.txt Jul 27 20:41:05.492 - [WARNING] network fail Jul 27 20:41:08.166 - [INFO] load google ip_list num:654, gws num:654 Jul 27 20:41:08.214 - [INFO] good ip num:651, bad ip num:3 Jul 27 20:41:08.399 - [INFO] OpenSSL support alpn /opt/lib/python2.7/site-packages/OpenSSL/crypto.py:1108: UserWarning: implicit cast from 'char *' to a different pointer type: will be forbidden in the future (check that the types are as you expect; use an explicit ffi.cast() if they are correct) Jul 27 20:41:08.788 - [INFO] server 0.0.0.0:8087 started. Jul 27 20:41:08.792 - [INFO] server 0.0.0.0:8086 started. Jul 27 20:41:08.832 - [INFO] PACServer from:127.0.0.1:47613 GET /proxy.pac Jul 27 20:41:17.299 - [INFO] ssl error: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] unknown error (_ssl.c:661), create full domain cert for host:duckduckgo.com Jul 27 20:41:17.522 - [INFO] ssl error: [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] unknown error (_ssl.c:661), create full domain cert for host:duckduckgo.com Jul 27 20:41:17.544 - [INFO] ssl error: [SSL: INAPPROPRIATE_FALLBACK] unknown error (_ssl.c:661), create full domain cert for host:duckduckgo.com Jul 27 20:41:17.564 - [INFO] ssl error: [SSL: INAPPROPRIATE_FALLBACK] unknown error (_ssl.c:661), create full domain cert for host:duckduckgo.com Jul 27 20:42:19.825 - [INFO] PACServer from:192.168.123.147:64592 GET /proxy.pac

xyuanmu commented 6 years ago

把data目录的 CA.crt 和certs文件夹删除,然后重启mini,手机访问:http://192.168.123.1:8086/CA.crt 下载证书安装。

doyard commented 6 years ago

@xyuanmu 这个我尝试过,还是会在certs文件夹生成特定网站cert,并且会快速不停的重试连接,日志上显示为被ssl error刷屏。 是不是和 openssl 版本有关系?

2017-07-28 8 38 07
SeaHOH commented 6 years ago

记得有人说过,新版 ios 设备导入证书后还需要设置信任。

doyard commented 6 years ago

@SeaHOH 求解怎么设置信任?? 点开CA.crt install的时候输入了手机的密码,手机profile里面有绿色 Verified 后面还有一个绿色的对勾。

xyuanmu commented 6 years ago

这个错误是尝试使用证书验证失败,重新生成新证书,按理来说你的证书应该是安装成功了,你旧版本会出现这个错误吗?比如1.2.9版本。

doyard commented 6 years ago

@xyuanmu 旧版本一样的问题,不同 的 是重新生成证书之后,打开 https://www.google.com.hk, 弹出警告信息,点 continue 和点 detail (点进去右上角有 trust )之后可以访问google,但是其他所有墙外网站都仍旧显示ssl error 我用电脑试了一下,配置了全局pac后,Safari能间歇性正常打开google.com.hk 和 duckduckgo,facebook.com和twitter.com一直都打不开、一小段时间后,google.com.hk 和 duckduckgo也打不开

我尝试用电脑启动XX-Mini,会自动导入证书到keychain里,正常使用,境外网站都打得开。

-- 结论: 放弃给路由器里装xx-mini了,配了每月500M免费流量的SS,目前一切正常。其他特殊需求,就在端处理了,不在网关折腾了,作为用户来讲折腾这个太耗费时间精力了

最后感谢各位。

lzhr commented 6 years ago

如果能把nodejs装进路由器,或许可以试试这个ss-heroku

doyard commented 6 years ago

@lzhr 谢谢,有空了研究研究node。