From cbda1260f54c7429a99e22ceb8513075b344a798 Mon Sep 17 00:00:00 2001 From: mmm29 <106432961+mmm29@users.noreply.github.com> Date: Sat, 15 Oct 2022 16:35:05 +0300 Subject: [PATCH] Allow authenticated SOCKS5 connections without a password --- python_socks/_proto/socks5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_socks/_proto/socks5.py b/python_socks/_proto/socks5.py index ac089d4..bb129b9 100644 --- a/python_socks/_proto/socks5.py +++ b/python_socks/_proto/socks5.py @@ -65,7 +65,7 @@ class AuthMethodsRequest: def __init__(self, username: str, password: str): auth_methods = bytearray([AuthMethod.ANONYMOUS]) - if username and password: + if username: auth_methods.append(AuthMethod.USERNAME_PASSWORD) self.auth_methods = auth_methods