Skip to content
SOCKS5 access

Username and password in SOCKS5: how access is verified

SOCKS5 does not begin by sending a username and password. The client first advertises supported methods and the server selects one. If username/password is chosen, both sides run a separate sub-negotiation before the client can send a relay command.

2 min readReviewed and updated: August 6, 2026

Key points in one minute

  • SOCKS5 authentication follows method selection.
  • Successful authentication does not guarantee destination connectivity.
  • RFC 1929 does not encrypt the password by itself.
  • Logs must not contain raw credentials.

Selecting the method

The client advertises only methods it can actually use. The server returns one selected identifier or reports that no method is acceptable. A mismatch at this stage cannot be fixed by changing the destination address.

Username/password sub-negotiation

RFC 1929 defines a separate message version, lengths, username, and password values. The server returns an authentication status. Length and encoding constraints matter when generating credentials or importing them into older clients.

After authentication succeeds

The client sends the SOCKS command and destination. Policy denial, network unreachability, or another relay error can still follow a correct password. A user interface should separate authentication status from relay status.

Protecting credentials

The username/password method provides no confidentiality of its own. A service protects the client-to-proxy hop with a trusted network or additional secure transport, stores secrets safely, and provides rotation and revocation controls.

Practical checklist

  1. 1Confirm the client offers username/password authentication.
  2. 2Display authentication and CONNECT as separate stages.
  3. 3Generate compatible usernames without control characters.
  4. 4Keep passwords out of logs and notifications.
  5. 5Rotate credentials if exposure is suspected.

Sources and documentation

This material is based on primary, official, and technical sources. The article is an original summary written for this knowledge base.

  1. 1.RFC Editor / IETF: SOCKS Protocol Version 5
  2. 2.RFC Editor / IETF: Username/Password Authentication for SOCKS V5
  3. 3.curl project: CURLOPT_PROXYTYPE

Continue reading

More articles on related topics

Routing boundaries

Why some traffic can bypass a proxy: PAC, DIRECT, and WebRTC

Read

Authentication

HTTP proxy authentication and the 407 response

Read

Access control

Password or allowed IP: choosing proxy access control

Read