Forum Discussion

M0d3u52014_1653's avatar
M0d3u52014_1653
Icon for Nimbostratus rankNimbostratus
May 02, 2016

IPV6 Virtual Server with IPV4 pool members all I get is error 400 The request hostname is invalid.

I a standard VS running as a public IPV6 address with a single IPV4 IIS 8.5 pool member behind it, separate VLANs using automap. I can reach the site no problem, and I know its doing so because the cert that shows up is the IIS cert I issued, but instead of displaying anything all I ever get is:

 

Bad Request - Invalid Hostname

 

HTTP Error 400. The request hostname is invalid.

 

On IIS I have made sure to not put a hostname in so that it should allow any host on the bindings, I suspect I may need to do something with rewrite? At any rate, from the documentation on using the built in ipv6 gateway this is supposed to be pretty straightforward and not need any real configuration. Am I missing something?

 

3 Replies

  • Hi,

     

    It seems the IIS server reject IPv6 format in Host header.

     

    Can you try by requesting with hostname instead of IPv6 address (configure hosts file)

     

  • The problem is that IIS will verify your source is an IPV4 address and the HTTP Host header is an IPV6 address thus it will reject that saying that is a Bad Hostname. I made an iRule in my case to to fix this:

     

    when HTTP_REQUEST {
      log local0.info "Processing iRule"
      set originalHostHeader [HTTP::header Host]
      if { $originalHostHeader contains "\[" } then {
        HTTP::header insert X-Host-Header $originalHostHeader
        set host [string map {"[" ""} $originalHostHeader]
        set host [string map {"]" ""} $host]
        set host [string map {":" "."} $host]
        HTTP::header replace Host $host
      }
    }

    That code is quite simple, just removing what is necessary to fool IIS to think isn't an IPV6 HTTP Host header. That way your IIS won't know that is an IPV6 and will accept the request...