Tomcat URL encoding

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tomcat URL encoding

Cai, Charles [COMRES/RTC/RTC]
Hi Guys,

Looking for help here after search on the web for couple hours:

I'm currently doing some testing on Tomcat 8.5.9   I'm trying to encode all the URL that is requesting to my server.
One thing I have noticed it wasn't working is the `\` (back slash) can't be allowed in the URL.

I'm getting the error saying:
INFO [https-jsse-nio-8443-exec-10] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

The test requesting URL is like this:
https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser

Currenty, I tried those two approachs:
1st, set the server.xml with URIEncoding:
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

2nd, add the following filter:
https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1

It should be like this after the encoding (replace `\` with `%5C` ) :
https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser

but none of those options worked for me.

Thank you

Charles Cai

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat URL encoding

Rossen Stoyanchev-3
You need to enable this through the ALLOW_BACKSLASH property:
https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html

On Thu, Jun 15, 2017 at 2:44 PM, Cai, Charles [COMRES/RTC/RTC] <
[hidden email]> wrote:

> Hi Guys,
>
> Looking for help here after search on the web for couple hours:
>
> I'm currently doing some testing on Tomcat 8.5.9   I'm trying to encode
> all the URL that is requesting to my server.
> One thing I have noticed it wasn't working is the `\` (back slash) can't
> be allowed in the URL.
>
> I'm getting the error saying:
> INFO [https-jsse-nio-8443-exec-10] org.apache.coyote.http11.Http11Processor.service
> Error parsing HTTP request header
>  Note: further occurrences of HTTP header parsing errors will be logged at
> DEBUG level.
> java.lang.IllegalArgumentException: Invalid character found in the
> request target. The valid characters are defined in RFC 7230 and RFC 3986
>
> The test requesting URL is like this:
> https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
>
> Currenty, I tried those two approachs:
> 1st, set the server.xml with URIEncoding:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>
> 2nd, add the following filter:
> https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
>
> It should be like this after the encoding (replace `\` with `%5C` ) :
> https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
>
> but none of those options worked for me.
>
> Thank you
>
> Charles Cai
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tomcat URL encoding

Mark Thomas-2
In reply to this post by Cai, Charles [COMRES/RTC/RTC]
On 15/06/2017 14:44, Cai, Charles [COMRES/RTC/RTC] wrote:

> Hi Guys,
>
> Looking for help here after search on the web for couple hours:
>
> I'm currently doing some testing on Tomcat 8.5.9   I'm trying to encode all the URL that is requesting to my server.
> One thing I have noticed it wasn't working is the `\` (back slash) can't be allowed in the URL.
>
> I'm getting the error saying:
> INFO [https-jsse-nio-8443-exec-10] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header
>   Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.
> java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
>
> The test requesting URL is like this:
> https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
>
> Currenty, I tried those two approachs:
> 1st, set the server.xml with URIEncoding:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>
> 2nd, add the following filter:
> https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
>
> It should be like this after the encoding (replace `\` with `%5C` ) :
> https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
>
> but none of those options worked for me.

It needs to be encoded on the client.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Tomcat URL encoding

Cai, Charles [COMRES/RTC/RTC]
In reply to this post by Rossen Stoyanchev-3
Sorry, I forgot mention, I already add the following to the catalina.properties file.

org.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true

It didn't seems worked for me neither.

Charles Cai | T +1 440 329 4888

-----Original Message-----
From: Rossen Stoyanchev [mailto:[hidden email]]
Sent: Thursday, June 15, 2017 3:11 PM
To: Tomcat Users List <[hidden email]>
Subject: Re: Tomcat URL encoding

You need to enable this through the ALLOW_BACKSLASH property:
https://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html

On Thu, Jun 15, 2017 at 2:44 PM, Cai, Charles [COMRES/RTC/RTC] < [hidden email]> wrote:

> Hi Guys,
>
> Looking for help here after search on the web for couple hours:
>
> I'm currently doing some testing on Tomcat 8.5.9   I'm trying to encode
> all the URL that is requesting to my server.
> One thing I have noticed it wasn't working is the `\` (back slash)
> can't be allowed in the URL.
>
> I'm getting the error saying:
> INFO [https-jsse-nio-8443-exec-10]
> org.apache.coyote.http11.Http11Processor.service
> Error parsing HTTP request header
>  Note: further occurrences of HTTP header parsing errors will be
> logged at DEBUG level.
> java.lang.IllegalArgumentException: Invalid character found in the
> request target. The valid characters are defined in RFC 7230 and RFC
> 3986
>
> The test requesting URL is like this:
> https://localhost:8443/passthrough.jsp?ntUserName=comany\testuser
>
> Currenty, I tried those two approachs:
> 1st, set the server.xml with URIEncoding:
> http://tomcat.apache.org/tomcat-7.0-doc/config/http.html
>
> 2nd, add the following filter:
> https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q1
>
> It should be like this after the encoding (replace `\` with `%5C` ) :
> https://localhost:8443/passthrough.jsp?ntUserName=comany%5Ctestuser
>
> but none of those options worked for me.
>
> Thank you
>
> Charles Cai
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Loading...