Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8154861

com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe, BasicAuth, Wrong Encoding, webservice-client

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 8u77
    • Fix Version/s: None
    • Component/s: xml
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      if the Plattform Encoding is not "ISO-8859-1", the class

      com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe

      do the wrong encoding to the Basic Auth header.

      Normally the webservice client uses this code to send the credentials.

      Map<String, Object> ctx = ((BindingProvider) port).getRequestContext();
      ctx.put(BindingProvider.USERNAME_PROPERTY, "user");
      ctx.put(BindingProvider.PASSWORD_PROPERTY, "üöä");

      The Basic-Auth header must be encoded with "ISO-8859-1" but the impletation in class "com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe" does not doing this.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      step into class

      com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe

      take a look where "BindingProvider.PASSWORD_PROPERTY" is used.

      the getBytes()-Method is called without StandardCharset.ISO_8859_1


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      // creating the header externally

      Map<String, Object> ctx = ((BindingProvider) port).getRequestContext();

      Map<String, List<String>> headers=new HashMap<String, List<String>>();

      headers.put("Authorization", Arrays.asList("Basic "+DatatypeConverter.printBase64Binary("user:üäö".getBytes(StandardCharsets.ISO_8859_1))));

      ctx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);


        Attachments

          Activity

            People

            • Assignee:
              aefimov Aleksej Efimov
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: