Shibboleth, Tomcat, AJP and UTF-8 conversion

Mark Juszczec mark.juszczec at gmail.com
Thu Oct 20 10:21:14 EDT 2016


On Thu, Oct 20, 2016 at 10:13 AM, Cantor, Scott <cantor.2 at osu.edu> wrote:

> > It seems to me, its more like Tomcat is following the spec and its
> having this
> > unpleasant side effect in a certain Shibboleth use case.
>
> The spec itself is broken, I would say. It can't assume an encoding given
> that the client can use any.
>
>
Do you mean the W3C spec?  I can't comment.  Those folks are waaaay above
my pay grade.


> In any case, I thought the usual fix for this was to add the encoding to
> the AJP connector. People have certainly said that that works.
>


Yes.  The common solution is to specify one or both of the following in
<Connector> in server.xml:

 URIEncoding="UTF-8"
useBodyEncodingForURI="true"

Unfortunately that has no impact on my problem.

I suspect its because my data, for whatever reason, is NOT coming to me %
encoded.  mod_jk is putting it into environment variables and the
delivering it via AJP in the body of a GET.

The data bytes are percolating thru Tomcat correctly (I've verified them)
until they get handled by ByteChunk and converted to a String.


> > String value= request.getHeader("givenName");
> > value= new String( value.getBytes("ISO-8859-1"), "UTF-8");
> >
> > In my case I'll have to use request.getAttribute("givenName"); because
> my
> > data is delivered via attributes.
>
> The trick there is running the encoding switch against the raw bytes of
> the source string, but it doesn't matter what the source string is.
>
>
Can you please explain that statement?  I don't understand.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20161020/045d3140/attachment-0001.html>


More information about the users mailing list