v2ray-core icon indicating copy to clipboard operation
v2ray-core copied to clipboard

v2ray 传输协议ws 访问google显示证书错误

Open yerphon opened this issue 6 years ago • 18 comments

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) 服务端latest 客户端v2rayN v2.52
  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 Chrome 通过Socks 访问google.com
  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等) 您的连接不是私密连接 攻击者可能会试图从 www.google.com 窃取您的信息(例如:密码、通讯内容或信用卡信息)。了解详情 NET::ERR_CERT_COMMON_NAME_INVALID Subject: *.facebook.com

Issuer: DigiCert SHA2 High Assurance Server CA

Expires on: 2020年4月15日

Current date: 2020年2月7日

证书错误 4) 你期待看到的正确表现是怎样的? 能上google.com,突然之间就不行了。 5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:

    {
  "log": {
    "loglevel": "warning",
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log"
  },
  "inbounds": [
    {
      "port": 1095,
      "protocol": "vmess",
      "settings": {
        "clients": [
          {
            "id": "",
            "alterId": 64
          }
        ]
      },
      "streamSettings": {
        "network":"ws"
      }
    }
  ],
  "outbounds": [
    {
      "protocol": "freedom",
      "settings": {}
    }
  ]
}

客户端配置:

    {
  "policy": null,
  "log": {
    "access": "",
    "error": "",
    "loglevel": "warning"
  },
  "inbounds": [
    {
      "tag": "proxy",
      "port": 10808,
      "listen": "127.0.0.1",
      "protocol": "socks",
      "sniffing": {
        "enabled": true,
        "destOverride": [
          "http",
          "tls"
        ]
      },
      "settings": {
        "auth": "noauth",
        "udp": true,
        "ip": null,
        "address": null,
        "clients": null
      },
      "streamSettings": null
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "protocol": "vmess",
      "settings": {
        "vnext": [
          {
            "address": "",
            "port": 1095,
            "users": [
              {
                "id": "",
                "alterId": 64,
                "email": "[email protected]",
                "security": "auto"
              }
            ]
          }
        ],
        "servers": null,
        "response": null
      },
      "streamSettings": {
        "network": "ws",
        "security": null,
        "tlsSettings": null,
        "tcpSettings": null,
        "kcpSettings": null,
        "wsSettings": {
          "connectionReuse": true,
          "path": null,
          "headers": null
        },
        "httpSettings": null,
        "quicSettings": null
      },
      "mux": {
        "enabled": true
      }
    },
    {
      "tag": "direct",
      "protocol": "freedom",
      "settings": {
        "vnext": null,
        "servers": null,
        "response": null
      },
      "streamSettings": null,
      "mux": null
    },
    {
      "tag": "block",
      "protocol": "blackhole",
      "settings": {
        "vnext": null,
        "servers": null,
        "response": {
          "type": "http"
        }
      },
      "streamSettings": null,
      "mux": null
    }
  ],
  "stats": null,
  "api": null,
  "dns": {
    "servers": [
      "1.1.1.1"
    ]
  },
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "port": null,
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api",
        "ip": null,
        "domain": null
      }
    ]
  }
}
  1. 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:


error.log无多余的错误

客户端错误日志:

   2020/02/07 23:54:52 tcp:127.0.0.1:49597 accepted tcp:t.co:443 [proxy] 
2020/02/07 23:54:53 tcp:127.0.0.1:49602 accepted tcp:www.facebook.com:443 [proxy] 
2020/02/07 23:54:54 tcp:127.0.0.1:49610 accepted tcp:www.facebook.com:443 [proxy] 
2020/02/07 23:55:11 tcp:127.0.0.1:49644 accepted tcp:www.facebook.com:443 [proxy] 
2020/02/07 23:55:11 tcp:127.0.0.1:49649 accepted tcp:www.facebook.com:443 [proxy] 
2020/02/07 23:55:41 tcp:127.0.0.1:49691 accepted tcp:www.facebook.com:443 [proxy] 
2020/02/07 23:56:45 tcp:127.0.0.1:49776 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:56:45 tcp:127.0.0.1:49777 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:56:45 tcp:127.0.0.1:49791 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:56:45 tcp:127.0.0.1:49794 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:56:45 tcp:127.0.0.1:49796 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:57:47 tcp:127.0.0.1:49889 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:57:47 tcp:127.0.0.1:49892 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:57:49 tcp:127.0.0.1:49895 accepted tcp:www.google.com:443 [proxy] 
2020/02/07 23:59:02 tcp:127.0.0.1:50033 accepted tcp:mtalk.google.com:5228 [proxy] 
2020/02/08 00:00:09 tcp:127.0.0.1:50139 accepted tcp:www.facebook.com:443 [proxy] 
2020/02/08 00:04:03 tcp:127.0.0.1:50411 accepted tcp:mtalk.google.com:5228 [proxy] 
2020/02/08 00:05:01 tcp:127.0.0.1:50475 accepted tcp:clients4.google.com:443 [proxy] 
2020/02/08 00:05:26 tcp:127.0.0.1:50504 accepted tcp:analytics.twitter.com:443 [proxy] 
2020/02/08 00:09:03 tcp:127.0.0.1:50769 accepted tcp:mtalk.google.com:5228 [proxy] 
2020/02/08 00:09:54 tcp:127.0.0.1:50924 accepted tcp:steamcommunity.com:443 [proxy] 
2020/02/08 00:09:55 tcp:127.0.0.1:50941 accepted tcp:steamcommunity.com:443 [proxy] 
2020/02/08 00:11:24 tcp:127.0.0.1:51066 accepted tcp:github-production-user-asset-6210df.s3.amazonaws.com:443 [proxy] 
2020/02/08 00:14:03 tcp:127.0.0.1:51248 accepted tcp:mtalk.google.com:5228 [proxy] 

  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。
      2020/02/07 15:54:53 tcp:59.39.148.62:6641 accepted tcp:www.facebook.com:443 
2020/02/07 15:54:53 tcp:59.39.148.62:6641 accepted tcp:www.facebook.com:443 
2020/02/07 15:55:11 tcp:59.39.148.62:7275 accepted tcp:www.facebook.com:443 
2020/02/07 15:55:11 tcp:59.39.148.62:7275 accepted tcp:www.facebook.com:443 
2020/02/07 15:55:41 tcp:59.39.148.62:7275 accepted tcp:www.facebook.com:443 
2020/02/07 15:56:45 tcp:59.39.148.62:6641 accepted tcp:www.google.com:443 
2020/02/07 15:56:45 tcp:59.39.148.62:6641 accepted tcp:www.google.com:443 
2020/02/07 15:56:45 tcp:59.39.148.62:7403 accepted tcp:www.google.com:443 
2020/02/07 15:56:45 tcp:59.39.148.62:7403 accepted tcp:www.google.com:443 
2020/02/07 15:56:45 tcp:59.39.148.62:7403 accepted tcp:www.google.com:443 
2020/02/07 15:57:47 tcp:59.39.148.62:6641 accepted tcp:www.google.com:443 
2020/02/07 15:57:47 tcp:59.39.148.62:6641 accepted tcp:www.google.com:443 
2020/02/07 15:57:48 tcp:59.39.148.62:7501 accepted tcp:www.google.com:443 
2020/02/07 15:59:02 tcp:59.39.148.62:6641 accepted tcp:mtalk.google.com:5228 
2020/02/07 16:00:08 tcp:59.39.148.62:6641 accepted tcp:www.facebook.com:443 
2020/02/07 16:04:02 tcp:59.39.148.62:6641 accepted tcp:mtalk.google.com:5228 
2020/02/07 16:05:01 tcp:59.39.148.62:6641 accepted tcp:clients4.google.com:443 
2020/02/07 16:05:25 tcp:59.39.148.62:6641 accepted tcp:analytics.twitter.com:443 
2020/02/07 16:09:02 tcp:59.39.148.62:6641 accepted tcp:mtalk.google.com:5228 
2020/02/07 16:09:53 tcp:59.39.148.62:6641 accepted tcp:steamcommunity.com:443 
2020/02/07 16:09:54 tcp:59.39.148.62:6641 accepted tcp:steamcommunity.com:443 
2020/02/07 16:11:25 tcp:59.39.148.62:6641 accepted tcp:github-production-user-asset-6210df.s3.amazonaws.com:443 
2020/02/07 16:14:03 tcp:59.39.148.62:6641 accepted tcp:mtalk.google.com:5228 
  1. 其它相关的配置文件(如 Nginx)和相关日志。

  2. 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray。

请预览一下你填的内容再提交。

yerphon avatar Feb 07 '20 16:02 yerphon

检查你本地计算机,为什么GOOGLE会使用FACEBOOK的证书

kslr avatar Feb 08 '20 02:02 kslr

我之前在Linux系统上用ssh隧道和Wireguard时也遇到过这种问题,访问Google和Wikipedia莫名其妙变为Facebook证书,有时刷新一下就好了,自从换了win10用v2ray后还没出现过这个问题。没准vps被中间人攻击了,你是不是再用vultr?

0ldw avatar Feb 08 '20 09:02 0ldw

我之前在Linux系统上用ssh隧道和Wireguard时也遇到过这种问题,访问Google和Wikipedia莫名其妙变为Facebook证书,有时刷新一下就好了,自从换了win10用v2ray后还没出现过这个问题。没准vps被中间人攻击了,你是不是再用vultr?

不是vultr,我在服务器上ping google是有响应的

yerphon avatar Feb 08 '20 09:02 yerphon

是在哪里发生了中间人攻击?

daiaji avatar Feb 08 '20 09:02 daiaji

是在哪里发生了中间人攻击?

这个难说唉

yerphon avatar Feb 08 '20 12:02 yerphon

同 macos 已在使用 ws + Let's Encrypt TLS ,刚才google还是用的facebook的证书 重启了一下客户端好了。

sionnx avatar Feb 11 '20 02:02 sionnx

+1 MacOS,服务器在Linode ws + Let's Encrypt + CloudFlare, 不只是Google会出现这个问题,但大部分时间都是发生在Google上,证书变成Facebook系的,过一会会自动变正常。

KurumiSerori avatar Feb 14 '20 17:02 KurumiSerori

是不是DNS被劫持了,或者使用的运营商的DNS?我曾经碰过同样的问题,换了公共DNS之后就好了

McLeeX avatar Feb 16 '20 08:02 McLeeX

是不是DNS被劫持了,或者使用的运营商的DNS?我曾经碰过同样的问题,换了公共DNS之后就好了

在多地多种网络环境下都碰到了这种情况,还蛮谜的,按道理来说估计跟本地环境有关,但想来想去没想到本地什么进程能有这种效果。关键是只有经过v2ray的网络访问会被劫持,其他网站不会。 我准备切换一下DNS观察一段时间。

KurumiSerori avatar Feb 16 '20 08:02 KurumiSerori

是不是DNS被劫持了,或者使用的运营商的DNS?我曾经碰过同样的问题,换了公共DNS之后就好了

在多地多种网络环境下都碰到了这种情况,还蛮谜的,按道理来说估计跟本地环境有关,但想来想去没想到本地什么进程能有这种效果。关键是只有经过v2ray的网络访问会被劫持,其他网站不会。 我准备切换一下DNS观察一段时间。

刚在我本地win10机器用nslookup查了几次解析,返回是这样的:

> nslookup www.google.com 8.8.8.8
服务器:  dns.google
Address:  8.8.8.8

非权威应答:
名称:    www.google.com
Addresses:  173.252.102.16
          199.59.150.11

> nslookup www.google.com 8.8.8.8
服务器:  dns.google
Address:  8.8.8.8

非权威应答:
名称:    www.google.com
Addresses:  69.171.228.74
          31.13.81.1

> nslookup www.google.com 114.114.114.114
服务器:  public1.114dns.com
Address:  114.114.114.114

非权威应答:
名称:    www.google.com
Addresses:  2404:6800:4008:802::2004
          208.101.60.87

每次查到的IP都不一样,但是这些IP用 https://ipinfo.io/ 查询指向的是facebook或者其他不清楚的服务器。无论本地用哪个DNS解析都是这个结果,我觉得和本地DNS污染之类的有关系。之前配置过DNS这个问题后来就消失了。

McLeeX avatar Feb 16 '20 08:02 McLeeX

是不是DNS被劫持了,或者使用的运营商的DNS?我曾经碰过同样的问题,换了公共DNS之后就好了

在多地多种网络环境下都碰到了这种情况,还蛮谜的,按道理来说估计跟本地环境有关,但想来想去没想到本地什么进程能有这种效果。关键是只有经过v2ray的网络访问会被劫持,其他网站不会。 我准备切换一下DNS观察一段时间。

刚在我本地win10机器用nslookup查了几次解析,返回是这样的:

> nslookup www.google.com 8.8.8.8
服务器:  dns.google
Address:  8.8.8.8

非权威应答:
名称:    www.google.com
Addresses:  173.252.102.16
          199.59.150.11

> nslookup www.google.com 8.8.8.8
服务器:  dns.google
Address:  8.8.8.8

非权威应答:
名称:    www.google.com
Addresses:  69.171.228.74
          31.13.81.1

> nslookup www.google.com 114.114.114.114
服务器:  public1.114dns.com
Address:  114.114.114.114

非权威应答:
名称:    www.google.com
Addresses:  2404:6800:4008:802::2004
          208.101.60.87

每次查到的IP都不一样,但是这些IP用 https://ipinfo.io/ 查询指向的是facebook或者其他不清楚的服务器。无论本地用哪个DNS解析都是这个结果,我觉得和本地DNS污染之类的有关系。之前配置过DNS这个问题后来就消失了。

~ kurumi$ nslookup www.google.com 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	www.google.com
Address: 75.126.33.156

kurumi$ nslookup www.google.com 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	www.google.com
Address: 216.58.200.36

kurumi$ nslookup www.google.com 8.8.8.8
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	www.google.com
Address: 31.13.64.33

kurumi$ nslookup www.google.com 114.114.114.114
Server:		114.114.114.114
Address:	114.114.114.114#53

Non-authoritative answer:
Name:	www.google.com
Address: 31.13.81.1

按照你说的方式查了一下,分别来自softlayer, google 和 facebook 以及 facebook,第二个IP打开也确实访问了Google的服务器。测试了一下,上游的DNS服务器应该是存在污染的。

不知道自己配置DNS是否会有帮助。或者最近在考虑用一下DOH,但比较担心延迟问题。

KurumiSerori avatar Feb 16 '20 09:02 KurumiSerori

你客户端上指定了dns servers1.1.1.1这个dns不要用,换成8.8.8.8,或者留空,让服务端自动检测

1265578519 avatar Feb 18 '20 21:02 1265578519

dns被污染或者劫持了,用tcp不要用udp,或者能走代理

GeekZhe [email protected] 于 2020年3月1日周日 下午5:41写道:

Closed #2227 https://github.com/v2ray/v2ray-core/issues/2227.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/v2ray/v2ray-core/issues/2227?email_source=notifications&email_token=AAG7ECYCGYMWE47ZUUOONDLRFIUVXA5CNFSM4KRRDNWKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOW7T4RLI#event-3085420717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG7EC73OR4NMFHEUCHFNPDRFIUVXANCNFSM4KRRDNWA .

txdywy avatar Mar 01 '20 09:03 txdywy

我用的 ss, 访问 twitter 有的时候也会变成证书是 *.facebook.com. 所以应该不是 v2ray 的问题, 准备换个DNS试试... (DNS问题) 我这个加了个hosts就好了 104.244.42.1 twitter.com

symant233 avatar Aug 19 '21 08:08 symant233

遇到这个问题的话可以尝试一下关闭IPv6,或者把IPv6的配置补全(虽然已经是上古issue但是因为出现在google搜索结果比较靠前所以还是决定补上)

Kiritow avatar Jul 21 '24 04:07 Kiritow

遇到这个问题的话可以尝试一下关闭IPv6,或者把IPv6的配置补全(虽然已经是上古issue但是因为出现在google搜索结果比较靠前所以还是决定补上)

@Kiritow 请问下补全IPv6配置是指什么? 我最近也遇到了这个问题,google搜索时会出现这个facebook的证书,过一阵子后恢复正常.

polarstormx avatar Aug 03 '24 03:08 polarstormx

是否与server端dns相关?

两个server一个可以正常连接,另一个时好时坏,最近访问Google返回*.facebook.com或*.internal.org的证书。在有问题的server上ping reddit会返回facebook的ip地址。 Screenshot 2024-11-13 131441

Waste2Time avatar Nov 13 '24 05:11 Waste2Time

是否与server端dns相关?

两个server一个可以正常连接,另一个时好时坏,最近访问Google返回*.facebook.com或*.internal.org的证书。在有问题的server上ping reddit会返回facebook的ip地址。 Screenshot 2024-11-13 131441

的确与服务器DNS相关,与客户端DNS无关。可以先排查下服务端能否正常ping到Google等。

Waste2Time avatar Nov 13 '24 09:11 Waste2Time