Bug 64225

Summary: An exception occurred while parse the given input as an HTTP Host header value
Product: Tomcat 9 Reporter: zhichun xie <xiezhichun>
Component: UtilAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: -----   
Hardware: PC   
OS: Mac OS X 10.1   

Description zhichun xie 2020-03-13 06:44:04 UTC
https://tools.ietf.org/html/rfc3986#page-18

'host:*' is http compliant, but the request will report an exception:

o.apache.coyote.http11.Http11Processor   : The host [*] is not valid
 Note: further occurrences of request parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: null
	at org.apache.tomcat.util.http.parser.Host.parse(Host.java:78)
	at org.apache.tomcat.util.http.parser.Host.parse(Host.java:45)
	at org.apache.coyote.AbstractProcessor.parseHost(AbstractProcessor.java:282)
	at org.apache.coyote.http11.Http11Processor.prepareRequest(Http11Processor.java:809)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)


The relevant source code is :
https://github.com/apache/tomcat/blob/master/java/org/apache/tomcat/util/http/parser/Host.java
Comment 1 Mark Thomas 2020-03-13 08:25:18 UTC
At the moment, reg-name is further restricted to valid DNS names. What name resolution service are you using?
Comment 2 Mark Thomas 2020-03-30 16:06:22 UTC
Noting that RFC 3986 states that:

<quote>
URI producers should use names that conform to the DNS syntax, even when use of DNS is not immediately apparent
</quote>

and that Tomcat is designed to use DNS;

and that there has been no response for 2 weeks I am closing this as WONTFIX but feel free to re-open if there is a use where Tomcat is used with a name resolution service that does not conform to the DNS syntax.