Steps to reproduce:
export ALL_PROXY=socks5://127.0.0.1:1080 (assume a SOCKS5 proxy server is there);
curl a ftp resource with no extra options;
you can see from strace that curl tries to connect to the ftp server directly but then take it as a SOCKS5 server.
A strace result is available in the attachment list. In addition, curl works fine with --socks5/--socks5-hostname option.
Which curl version is this?
$ curl -V
curl 7.30.0 (x86_64-unknown-linux-gnu) libcurl/7.30.0 OpenSSL/1.0.1e zlib/1.2.7 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
I've written a test case now that seems to repeat it. Oddly it works if --socks5 [proxy] is used (as in test 707), but not if set in an environment variable.
Now I'll just have to figure out why so and fix!
I'm attaching test711 that repeats the problem.
Thanks a lot for your report! I've now pushed a fix (together with 2 new test cases to help us avoid regressions), available in commit 0523152ad6e9d558. Closing this issue.