shadowsocks / shadowsocks-windows

A C# port of shadowsocks
Other
58.43k stars 16.4k forks source link

shadowsocks-windows doesn't work in Windows 10.0.15063 (1703) #1125

Closed liyuhang1997 closed 7 years ago

liyuhang1997 commented 7 years ago

Version(release version or AppVeyor link)

3.4.3/4.0.1

Environment(Operating system, .NET Framework, etc)

Windwos 10.0.15063.138 (rs2_release_svc_escrow.170331-1347)

Steps you have tried

This strange problem occurred after I updated to Windows 10.0.15063 (1703), before that, it's all right. Sometimes I try to dial- up connection, dial 10 seconds after I can normally visit google, sometimes, when I restart Windows 10, it can always be used normally, but when I shut down the next time after the boot When it can not work properly.

  1. switching to another shadowsocks server, another browser
  2. reinstall shadowsocks-libev, shadowsocks-windows (3.4.3 and 4.0.1)
  3. reboot the Windows 10 system
  4. clean all configs and pac file
  5. copy /Shadowsocks-3.4.3/ and /Shadowsocks-4.0.1/ to E:\Programs Files
  6. Run as Administrator
  7. use shadowsocks-qt5

What did you expect to see?

visit google and youtube

What did you see instead?

Chrome said:

无法访问此网站

mail.google.com 的响应时间过长。
请试试以下办法:
检查网络连接
检查代理服务器和防火墙
运行 Windows 网络诊断
ERR_CONNECTION_TIMED_OUT

Config and error log in detail (with all sensitive info masked)

Config:

{
  "configs": [
    {
      "server": "xxx.xxx.xxx.xxx",
      "server_port": xxxx,
      "password": "xxxx",
      "method": "aes-256-cfb",
      "remarks": "",
      "timeout": 5
    },
    {
      "server": "xxx.xxx.xxx.xxx",
      "server_port": xxxx,
      "password": "xxxx",
      "method": "aes-256-cfb",
      "remarks": "",
      "timeout": 5
    },
    {
      "server": "xxx.xxx.xxx.xxx",
      "server_port": xxxx,
      "password": "xxxx",
      "method": "aes-256-cfb",
      "remarks": "",
      "timeout": 5
    },
    {
      "server": "xxx.xxx.xxx.xxx",
      "server_port": xxxx,
      "password": "xxxx",
      "method": "aes-256-cfb",
      "remarks": "",
      "timeout": 5
    }
  ],
  "strategy": null,
  "index": 0,
  "global": false,
  "enabled": true,
  "shareOverLan": false,
  "isDefault": false,
  "localPort": 1080,
  "pacUrl": null,
  "useOnlinePac": false,
  "secureLocalPac": true,
  "availabilityStatistics": false,
  "autoCheckUpdate": true,
  "checkPreRelease": false,
  "isVerboseLogging": true,
  "logViewer": {
    "topMost": false,
    "wrapText": false,
    "toolbarShown": false,
    "Font": "Consolas, 8pt",
    "BackgroundColor": "Black",
    "TextColor": "White"
  },
  "proxy": {
    "useProxy": false,
    "proxyType": 1,
    "proxyServer": "127.0.0.1",
    "proxyPort": 1080,
    "proxyTimeout": 3
  },
  "hotkey": {
    "SwitchSystemProxy": "",
    "SwitchSystemProxyMode": "",
    "SwitchAllowLan": "",
    "ShowLogs": "",
    "ServerMoveUp": "",
    "ServerMoveDown": ""
  }
}

Shadowsocks log:

[2017-04-21 16:51:32] Shadowsocks started
[2017-04-21 16:51:35] connect to api.github.com:443
[2017-04-21 16:51:37] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接。
   在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
   在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
   在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2017-04-21 16:51:37] connect to api.github.com:443
[2017-04-21 16:51:39] System.Net.Sockets.SocketException (0x80004005): 由于目标计算机积极拒绝,无法连接。
   在 Shadowsocks.Util.Sockets.WrappedSocket.EndConnect(IAsyncResult asyncResult)
   在 Shadowsocks.Proxy.DirectConnect.EndConnectDest(IAsyncResult asyncResult)
   在 Shadowsocks.Controller.TCPHandler.ConnectCallback(IAsyncResult ar)
[2017-04-21 16:51:39] System.Reflection.TargetInvocationException: 操作过程中出现异常,结果无效。  有关异常的详细信息,请查看 InnerException。 ---> System.Net.WebException: 基础连接已经关闭: 发送时发生错误。 ---> System.IO.IOException: 由于远程方已关闭传输流,身份验证失败。
   在 System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   在 System.Net.PooledStream.EndWrite(IAsyncResult asyncResult)
   在 System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   在 System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   在 System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
   --- 内部异常堆栈跟踪的结尾 ---
   在 System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   在 Shadowsocks.Controller.UpdateChecker.http_DownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e)
wongsyrone commented 7 years ago

I will check this when I upgrade to the new Win10, currently no plan.

andronoob commented 7 years ago

Shadowsocks 4.0.1.0 works well on my Windows 10 1703 (15063.138) x64. Did your shadowsocks server work properly?

liyuhang1997 commented 7 years ago

It's OK, my laptop and cell phone is working fine.

liyuhang1997 commented 7 years ago

@andronoob @wongsyrone Hello, I tried shadowsocks 2.5.6, 2.5.8, 3.0, 3.2, 3.3, 3.3.1, 3.3.2, all working well! Since the 3.3.3 version, this question has been reproduced, so, I thinks it might be a bug with this change Use wininet API to setup system proxy

celeron533 commented 7 years ago

In step 6, why you want to run shadowsocks with administrator privilege? Please try to execute with normal user.

liyuhang1997 commented 7 years ago

@celeron533 This is not a step, but an option I have tried.

andronoob commented 7 years ago

@liyuhang1997 I'm not using shadowsocks to change system proxy settings. Maybe the "Enable system proxy" option is to blame?

henrylethe commented 7 years ago

@liyuhang1997 Same thing happened here. The built-in browser like IE and Edge couldn't be used normally with shadowsocks, due to that "Settings -> Network and Internet -> Proxy" is always reset once in a while.

Restart the shadowsocks could fix it. However, it seems that the new Win10 would abandon the system proxy settings set up by shadowsocks after a while.

Meanwhile, chrome with switchyOmega is an option for now.

VictoriousRaptor commented 7 years ago

@liyuhang1997 I've got a similar situation. And I think my log here may prove that something about win api has changed. From shadowsocks 4.0.1 and Windows 10 1703 version

[2017-04-29 21:35:08] Shadowsocks started [2017-04-29 21:35:08] Shadowsocks.Util.SystemProxy.ProxyException: Error query options: 12178 (null) 在 Shadowsocks.Util.SystemProxy.Sysproxy.ExecSysproxy(String arguments, String& queryStr) 在 Shadowsocks.Util.SystemProxy.Sysproxy.SetIEProxy(Boolean enable, Boolean global, String proxyServer, String pacURL) 在 Shadowsocks.Controller.SystemProxy.Update(Configuration config, Boolean forceDisable, PACServer pacSrv)

ReVanTis commented 7 years ago

@BurningRaptor I'm seeing the very same issue with same log on 2 of my windows 10 PCs which are both on 1703 (15063.138). Forgot to mention, the same log appears when toggling Enable System Proxy.

But I'm not sure if it is the same issue from the original reporter.

I believe the exception info is given by sysproxy.exe, I further looked into the code the error was generated at main.c:line 85: BOOL result = InternetSetOption(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, options, sizeof(INTERNET_PER_CONN_OPTION_LIST));

Furthermore, I also checked if I can set proxy settings manually and I found both under IE's proxy settings or the modern settings I cannot set proxy settings. Clicking on OK or Save button won't save the changes.

I suspect it's a windows related issue or a change from windows api.

moreoronce commented 7 years ago

I got an error too after i update my work computer to 1703.

When shadowsocks set to system proxy, i could not access 192.168.X.X and localhost after update windows to 1703. And the error message is 500 from privoxy.

When i unset shadowsocks to system proxy, all the network would be fine just could not accessed the blocked website.

I've checked the log when i got error 500 but there were nothing.

yusiwen commented 7 years ago

Weird, my box runs windows 10 x64 1703 build 15063.250 as well, and shadowsocks-windows runs well including system-wide proxy. It must be some windows related issues.

wongsyrone commented 7 years ago

For 1703, try to disable windows defender completely and reboot to take effect

ReVanTis commented 7 years ago

@wongsyrone Just to feedback, I'm under group policy control and windows defender is always disabled by it. Turning off 3rd party anti virus software did not help.

Vohrt commented 7 years ago

@wongsyrone Turning off windows defender didn't help on my laptop.

celeron533 commented 7 years ago

Works well on my test environment. It's a clean Win 10 installation in Hyper-V. Everything are in default settings. System image en_windows_10_enterprise_version_1703_updated_march_2017_x64_dvd_10189290.iso

SS-win 4.0.1

Host Name:                 DESKTOP-IPO9UIH
OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.15063 N/A Build 15063
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Windows User
Registered Organization:
Product ID:                00329-00000-00003-AA343
Original Install Date:     5/19/2017, 5:57:21 AM
System Boot Time:          5/19/2017, 5:53:20 AM
System Manufacturer:       Microsoft Corporation
System Model:              Virtual Machine
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 58 Stepping 9 GenuineIntel ~1796 Mhz
BIOS Version:              Microsoft Corporation Hyper-V UEFI Release v2.0, 8/26/2016
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume2
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC-08:00) Pacific Time (US & Canada)
Total Physical Memory:     1,915 MB
Available Physical Memory: 718 MB
Virtual Memory: Max Size:  3,067 MB
Virtual Memory: Available: 1,739 MB
Virtual Memory: In Use:    1,328 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\WIN-63KBC272AR3
Hotfix(s):                 N/A
Network Card(s):           1 NIC(s) Installed.
                           [01]: Microsoft Hyper-V Network Adapter
                                 Connection Name: Ethernet
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.1.1
                                 IP address(es)
                                 [01]: 192.168.1.8
                                 [02]: fe80::3517:175:c420:cc47
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.

image