Skip to content

Commit b00ecb1

Browse files
committed
socks: SOCKS5 proxy with empty password should be allowed
The behavior is accepted widely, and I found no reason to deny it. Fixes #57285
1 parent e1ec361 commit b00ecb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/socks/socks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
289289
case AuthMethodNotRequired:
290290
return nil
291291
case AuthMethodUsernamePassword:
292-
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
292+
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
293293
return errors.New("invalid username/password")
294294
}
295295
b := []byte{authUsernamePasswordVersion}

0 commit comments

Comments
 (0)