1 Reply Latest reply on Mar 21, 2002 10:18 PM by 807554

    HttpURLConnection -- getting error 502 passing ftp url  w embedded password

      I am connecting to http proxy server which supports cern ftp.

      I specify the -DftpProxySet command line options to point java to the http proxy.

      I specify a ftp url like following and it works OK:


      it works fine.

      But when I change the ftp server to require password and pass ftp url such as

      ftp://user:password@machine.company.com/readme.txt. , it fails.

      It works OK when I type above password ftp Url manually into the IE browser that is pointing to same http proxy the java is using.


      java.io.IOException: Server returned HTTP response code: 502 for URL: ftp://user:password@machine.company.com/readme.txt
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:562) at com.mycompany....Line 300

      Line 300:

      InputStream stream = connection.getInputStream();