ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31358] New: - HTTP Get Task does not support basic proxy authentication
Date Wed, 22 Sep 2004 10:32:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31358>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31358

HTTP Get Task does not support basic proxy authentication

           Summary: HTTP Get Task does not support basic proxy
                    authentication
           Product: Ant
           Version: 1.6.2
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: java.coder@winterthur.ch


I propose to add two properties (proxyUser, proxyPassword) to the Get task,
which can be used for basic proxy authentication. For this, the execute method
needs some additional lines:

if (proxyUname != null || proxyPword != null) {
    String up = proxyUname + ":" + proxyPword;
    String encoding;
    // check to see if sun's Base64 encoder is available.
    try {
        Object encoder =
                Class.forName("sun.misc.BASE64Encoder").newInstance();
        encoding = (String)
                encoder.getClass().getMethod("encode", new Class[] {byte[].class})
                .invoke(encoder, new Object[] {up.getBytes()});

    } catch (Exception ex) { // sun's base64 encoder isn't available
        Base64Converter encoder = new Base64Converter();
        encoding = encoder.encode(up.getBytes());
    }
    connection.setRequestProperty("Proxy-Authorization", "Basic " + encoding);
}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message