Skip to content

Commit

Permalink
socks: SOCKS5 proxy with empty password should be allowed
Browse files Browse the repository at this point in the history
The behavior is accepted widely, and I found no reason to deny it.

Fixes #57285
  • Loading branch information
iseki0 committed Dec 13, 2022
1 parent e1ec361 commit b00ecb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/socks/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
case AuthMethodNotRequired:
return nil
case AuthMethodUsernamePassword:
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
return errors.New("invalid username/password")
}
b := []byte{authUsernamePasswordVersion}
Expand Down

0 comments on commit b00ecb1

Please sign in to comment.