diff options
Diffstat (limited to 'netlib/socks.py')
-rw-r--r-- | netlib/socks.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/netlib/socks.py b/netlib/socks.py index 30fe1c9d..377308a8 100644 --- a/netlib/socks.py +++ b/netlib/socks.py @@ -2,7 +2,8 @@ import struct import array import ipaddress -from netlib import tcp, utils +from netlib import tcp +from netlib import check from mitmproxy.types import bidi @@ -204,7 +205,7 @@ class Message: elif atyp == ATYP.DOMAINNAME: length, = struct.unpack("!B", f.safe_read(1)) host = f.safe_read(length) - if not utils.is_valid_host(host): + if not check.is_valid_host(host): raise SocksError(REP.GENERAL_SOCKS_SERVER_FAILURE, "Invalid hostname: %s" % host) host = host.decode("idna") use_ipv6 = False |