SOCKS5 Authentication Methods (RFC 1929)
Before a SOCKS5 proxy relays your traffic it negotiates how to authenticate you. This guide walks through the SOCKS5 method-negotiation handshake from RFC 1928, the username/password scheme from RFC 1929, and what it means in practice — including the plaintext caveat.
The method-negotiation handshake
SOCKS5 (defined in RFC 1928) does not assume an authentication method — it negotiates one. As soon as the TCP connection to the proxy opens, the client sends a greeting listing the authentication methods it supports, and the proxy picks one.
The client's greeting is: a version byte (0x05), a count of methods, then that many method identifiers. The common methods are 0x00 "no authentication required", 0x02 "username/password", and 0xFF "no acceptable methods". The server replies with two bytes: the version and the single method it chose. If it returns 0x00, you connect straight away; if it returns 0x02, the client must now run the username/password sub-negotiation before it can issue any connect request. If the server returns 0xFF, none of the offered methods was acceptable and it closes the connection. This is why an authenticated s4m SOCKS5 proxy on port 1080 expects your client to offer method 0x02.
Username/password: RFC 1929
The username/password method (0x02) is specified separately in RFC 1929. It is a tiny, self-contained exchange that happens after method negotiation and before the SOCKS request:
- The client sends: a sub-negotiation version byte (
0x01— note this is the auth version, not the SOCKS version), a one-byte username length, the username, a one-byte password length, and the password. - The server replies with two bytes: the version (
0x01) and a status byte.0x00means success; anything else means failure, and the server closes the connection.
Only after a success status does the client proceed to the actual SOCKS5 CONNECT request naming the destination. Because both username and password are length-prefixed single bytes, each is limited to 255 bytes. See our proxy authentication guide for how this plays out with real clients and the API for credential handling.
The plaintext caveat and how to handle it
RFC 1929 sends the username and password in plaintext between the client and proxy. HTTPS to the destination does not encrypt this authentication exchange.
Use a trusted network path or an encrypted transport explicitly supported by the provider. A dedicated IP does not encrypt credentials or replace them on current s4m endpoints. Related topic: dedicated IP.
Questions, answered
How does SOCKS5 decide which authentication method to use?
It negotiates. The client opens with a greeting listing the methods it supports (such as 0x00 no-auth and 0x02 username/password), and the server replies with the single method it chooses. If the server picks 0x02, the client then runs the RFC 1929 username/password exchange before sending its connect request.
Is SOCKS5 username/password authentication encrypted?
RFC 1929 sends the username and password in plaintext between the client and proxy. HTTPS to the destination does not encrypt this authentication exchange. Use a trusted network path or an encrypted transport explicitly supported by the provider. A dedicated IP does not encrypt credentials or replace them on current s4m endpoints. Related topic: dedicated IP.
What is the difference between RFC 1928 and RFC 1929?
RFC 1928 defines SOCKS5 itself, including the method-negotiation handshake where client and server agree on an authentication method. RFC 1929 defines just one of those methods — the username/password scheme — with its own sub-negotiation version byte and message format. They work together.
Authenticated SOCKS5, done right
Configure s4m SOCKS5 or HTTP access with the credentials from your account.
People found this page by searching for
- SOCKS5 authentication methods (RFC 1929)
- proxy setup settings
- WhatsApp proxy
- proxy setup
- how to configure socks5 proxy
- openvpn comparison
- ip address
- vpn kill switch for android
- best proxy for scraping 2026
- what is an IP address
- browser fingerprinting
- IPv6 proxies: cheap but useless
- wireguard
- wireguard for scraping
Real search phrases this page answers — the linked ones open the page that covers them in depth.