using proxy with (basic-) authentification does not work
--------------------------------------------------------

         Key: XERCESJ-1030
         URL: http://nagoya.apache.org/jira/browse/XERCESJ-1030
     Project: Xerces2-J
        Type: Bug
    Versions: 2.6.2    
 Environment: proxy with (basic-) authentification, Sun JavaVM 1.4.2, SuSE 
Linux machine
    Reporter: Martin Stechert


I'm validating XML documents against XSD schemas using xerces.
Some Schemas contain import-directives, that point to the internet, e.g. 
"http://www.w3.org/2001/xml.xsd"; imported from a uddi_v2 schema.
I'm using a HTTP proxy that requires (basic-) authentification.
I'm passing appropriate properties to the JavaVM:
- http.proxySet=true
- http.proxyHost=...
- http.proxyPort=...
- http.nonProxyHosts=...
- http.proxyUser=...
- http.proxyPassword=...

Xerces uses the proxy but does not care about the authentification.

As a Workarround I've added some code to XMLEntityManager (method 
setupCurrentEntity, just after getting the URLConnection, before getting the 
InputStream):
                // workarround: do proxy settings
                Properties systemSettings = System.getProperties();
                Object myProxyUserObject = systemSettings.get("http.proxyUser");
                if (null != myProxyUserObject) {
                    String myProxyUser = myProxyUserObject.toString();
                    System.out.println("%%% XMLEntityManager: using proxy user 
" + myProxyUser + " ...");
                    String proxyPassword = 
(systemSettings.get("http.proxyPassword")).toString();
                    sun.misc.BASE64Encoder encoder = new 
sun.misc.BASE64Encoder();
                    String myAuthToken = myProxyUser + ":" + proxyPassword;
                    String encodedUserPwd = 
encoder.encode(myAuthToken.getBytes());
                    connect.setRequestProperty("Proxy-Authorization", "Basic " 
+ encodedUserPwd);
                }

Is there a better (standard) way to convince Xerces using proxy 
authentification?

Is there a chance to get such code in the Xerces distribution?

Regards,
Martin.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to