3.9.4.1.1 Establishing a SOCKS Encapsulation Connection

The ConnectionState MUST be set to 'Negotiating'.

The client checks the SOCKS proxy configuration information before establishing any TCP connections. If a proxy is NOT configured, then SOCKS connections MUST NOT be attempted.

The client prepares a SOCKS Identifier Request Message as specified in [RFC1928], section 3.

The VER field MUST be set to 0x05.

The number of methods and method identifiers (see [RFC1928], section 3) supported by the client MUST be specified in the NMETHODS and METHODS fields<63>. The following methods SHOULD be specified in the message<64>:

0x00 (NO AUTHENTICATION REQUIRED)

0x02 (USERNAME and PASSWORD)

The ConnectionEstablishment timer and NetworkReceiveIO timer SHOULD both be started.

The client MUST establish a TCP connection to the proxy identified with ProxyServerHostName and ProxyServerPort and send the SOCKS Version Identifier Request.