Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.2.5
-
None
-
None
Description
HttpTransact::HandleBlindTunnel creates a fake request with HTTP version 0.9 and CONNECT method. The URL for CONNECT used is created from destination IP and port - currently this is IPv4 only.
requests with IPv6 destination IP addresses still work fine with the BlindTunnel since ATS is able to figure out the correct IPv6 destination from the Host Header of the fake URL. So this is a problem just in the ATS logging
attached is a suggested patch for 3.2 - the latest version of the file hasn't changed much since then
--- trafficserver-3.2.0/proxy/http/HttpTransact.cc 2014-08-15 16:05:40.625721000 +0100 +++ trafficserver-3.2.0.patched/proxy/http/HttpTransact.cc 2014-08-15 16:58:23.563658000 +0100 @@ -615,11 +615,12 @@ HTTPVersion ver(0, 9); s->hdr_info.client_request.version_set(ver); - struct in_addr dest_addr; - dest_addr.s_addr = s->state_machine->ua_session->get_netvc()->get_local_ip(); - - char *new_host = inet_ntoa(dest_addr); + // struct in_addr dest_addr; + // dest_addr.s_addr = s->state_machine->ua_session->get_netvc()->get_local_ip(); + char new_host[INET6_ADDRSTRLEN]; + ats_ip_ntop(s->state_machine->ua_session->get_netvc()->get_local_addr(), new_host, sizeof(new_host)); s->hdr_info.client_request.url_get()->host_set(new_host, strlen(new_host)); + // get_local_port() returns a port number in network order //opwv- FastPath // so it needs to be converted to host order (eg, in i386 machine) //opwv- FastPath //s->hdr_info.client_request.url_get()->port_set(ntohs(s->state_machine->ua_session->get_netvc()->get_local_port())); //opwv- FastPath
With patch:
IPv4:
Aug 18 09:49:24 - INFO - +++++++++ Proxy's Request +++++++++
Aug 18 09:49:24 - INFO - – State Machine Id: 2
Aug 18 09:49:24 - INFO - CONNECT 10.20.51.53:443 HTTP/1.1^M
Aug 18 09:49:24 - INFO - Host: 10.20.51.53^M
Aug 18 09:49:24 - INFO - Connection: close^M
Aug 18 09:49:24 - INFO - ^M
IPv6:
Aug 18 09:47:18 - INFO - +++++++++ Proxy's Request +++++++++
Aug 18 09:47:18 - INFO - – State Machine Id: 0
Aug 18 09:47:18 - INFO - CONNECT [2001:410:0:51:20d:60ff:fe9c:eec4]:443 HTTP/1.1^M
Aug 18 09:47:18 - INFO - Host: 2001:410:0:51:20d:60ff:fe9c:eec4^M
Aug 18 09:47:18 - INFO - Connection: close^M
Aug 18 09:47:18 - INFO - ^M
without patch:
Aug 13 14:44:45 - INFO - +++++++++ Proxy's Request +++++++++
Aug 13 14:44:45 - INFO - – State Machine Id: 17
Aug 13 14:44:45 - INFO - CONNECT 0.0.0.0:443 HTTP/1.1^M
Aug 13 14:44:45 - INFO - Host: 2001:410:0:51:20d:60ff:fe9c:eec4^M
Aug 13 14:44:45 - INFO - Connection: close^M
Aug 13 14:44:45 - INFO - ^M