shadowsocks / shadowsocks-rust

A Rust port of shadowsocks
https://shadowsocks.org/
MIT License
8.61k stars 1.17k forks source link

not support authentication #1385

Closed hellomsg closed 10 months ago

hellomsg commented 10 months ago

ERROR socks5 tcp client handler error: currently shadowsocks-rust does not support authentication.

...
{
      "local_address": "0.0.0.0",
      "local_port": 1080,
      "mode": "tcp_and_udp",
      "socks5_auth_config_path": "socks5_auth.json",
      "launchd_tcp_socket_name": "TCPListener",
      "launchd_udp_socket_name": "UDPListener"
    }
...

socks5_auth.json:

{
    "password": {
        "users": [
            {
                "user_name": "default",
                "password": "xxxx"
            }
        ]
    }
}
zonyitoo commented 10 months ago

Read the doc carefully, socks5_auth_config_path is not supported by the basic configuration format.

hellomsg commented 10 months ago

Read the doc carefully, socks5_auth_config_path is not supported by the basic configuration format. Of course, I wrote it according to the document.

{
  "locals": [
    {
      "local_address": "0.0.0.0",
      "local_port": 1080,
      "socks5_auth_config_path": "socks5_auth.json",
      "mode": "tcp_and_udp",
      "launchd_tcp_socket_name": "TCPListener",
      "launchd_udp_socket_name": "UDPListener"
    },
    {
      "protocol": "socks",
      "local_address": "0.0.0.0",
      "local_port": 1081,
      "mode": "tcp_and_udp",
      "local_udp_address": "0.0.0.0",
      "local_udp_port": 2081,
      "launchd_tcp_socket_name": "TCPListener",
      "launchd_udp_socket_name": "UDPListener"
    },
...
zonyitoo commented 10 months ago

I believe you are running an old version that doesn't support socks5 auth.

hellomsg commented 10 months ago

I believe you are running an old version that doesn't support socks5 auth.

shadowsocks-v1.17.1.x86_64-unknown-linux-musl.tar.xz

hellomsg commented 10 months ago
image
zonyitoo commented 10 months ago

https://github.com/shadowsocks/shadowsocks-rust/blob/4d0afeac6a29c84ac9a5680f9e28a1e133b5d9a6/crates/shadowsocks-service/src/local/socks/server/socks5/tcprelay.rs#L66-L106

It seems that the method macOS was using is not PASSWORD.

zonyitoo commented 10 months ago

Rerun sslocal with -vvv and see what exactly the Auth request was.

hellomsg commented 10 months ago

Rerun sslocal with -vvv and see what exactly the Auth request was.

2023-12-18T18:02:26.341736483+08:00 TRACE [11957:140057523637048] [shadowsocks_service::local::socks::server::socks5::tcprelay] socks5 HandshakeRequest { methods: [0] }
2023-12-18T18:02:26.341799235+08:00 TRACE [11957:140057523637048] [shadowsocks_service::local::socks::server::socks5::tcprelay] none authentication method is not allowed
2023-12-18T18:02:26.341825259+08:00 TRACE [11957:140057523637048] [shadowsocks_service::local::socks::server::socks5::tcprelay] reply handshake HandshakeResponse { chosen_method: 255 }
2023-12-18T18:02:26.341867808+08:00 ERROR [11957:140057523637048] [shadowsocks_service::local::socks::server::server] socks5 tcp client handler error: currently shadowsocks-rust does not support authentication
zonyitoo commented 10 months ago

Well, the request from client didn't require any authentication. So the request was rejected.

The error message is misleading, I will fix that later.

hellomsg commented 10 months ago

Well, the request from client didn't require any authentication. So the request is rejected.

ok, maybe the mac's client has problem. I will try other clients.

hellomsg commented 10 months ago

same problem on Mac Os. https://github.com/rofl0r/microsocks/issues/17

amircybersec commented 8 months ago

@hellomsg I can confirm the issue is related to MacOS's client...