I am using the libcurl version 7.10.3 on solaris
When I tried to connect to a SOCKS5 proxy using libcurl, got an error saying 'User was rejected by
SOCKS5 Server(1,0)' . Then I went through the url.c file and found one bug in the 'handleSock5Proxy'
function, the bug is in checking the subnegotiation version of the server response, the version will be 1
and current code is checking for 5 and returning with the above error message.
I hope this error will be corrected in the next version
regards,
Jis
Logged In: YES
user_id=1110
So, is this patch fixing the problem for you? I don't have
access to any socks5 proxy so I can't try this out myself!
--- url.c 21 May 2003 08:08:50 -0000 1.276
+++ url.c 22 May 2003 21:21:27 -0000
@@ -1535,7 +1535,7 @@
return 1;
}
- if ((socksreq[0] != 5) || /* version */
+ if ((socksreq[0] != 1) || /* version */
(socksreq[1] != 0)) { /* status */
failf(conn->data, "User was rejected by the SOCKS5
server (%d %d).",
socksreq[0], socksreq[1]);
Logged In: YES
user_id=1110
ok, this is now in the cvs
Logged In: YES
user_id=511066
According to the RFC, http://www.faqs.org/rfcs/rfc1928.html
that behavior is now incorrect. See "6. Replies" in that URL.
+----+-----+-------+------+----------+----------+
|VER | REP | RSV | ATYP | BND.ADDR | BND.PORT |
+----+-----+-------+------+----------+----------+
| 1 | 1 | X'00' | 1 | Variable | 2 |
+----+-----+-------+------+----------+----------+
Where:
o VER protocol version: X'05'
o REP Reply field:
o X'00' succeeded
If your SOCKS5 proxy is returning 1 in the VER field then it
is non-compliant.
Logged In: YES
user_id=1110
AFAICS, we are already checking for the 5 in the first byte,
url.c:1610 in CVS.
Logged In: NO
In http://cvs.php.net/annotate.php/curl/lib/url.c?rev=1.336,
line 1611 is the procedure method response (RFC 1928
section 3), which is still correctly demanding 5. However line
1654 is the reply response (RFC 1928 section 6), which is now
incorrectly demanding 1.
Logged In: NO
This was resolved by http://cvs.php.net/diff.php/curl/lib/url.c?
r1=1.336&r2=1.337&ty=h