Home > web > solutions!

solutions!

July 1st, 2002 osterday

well, the prolific writer in me must have come to an end. just been busy – that’s the usual excuse for not posting, right? well, last week was busy, frustrating, but ultimately productive.

i solved the ms isa proxy issue with our application, thinkingfolders (tf). took a few days ’cause i’ve been focused on development over networking. i got a crash course in cisco switch configuration – we had a spare 2912 that i configured to mirror ethernet traffic from the internal nic of the isa box to a linux box running snort to log the http traffic being sent to/from our tf client applet. i also configured an external 2924 switch to mirror the external http traffic send to/from the isa box to moby (my laptop) running snort to capture those packets. (snort rocks – i’ll post more later)

the issue we had was that our applet, which makes soap requests to a servlet, would throw a internet file read error or something like that, after making the request – when ie was set to use the isa box for its proxy. this only happend when ie was set to use isa as a proxy, not with the firewall client installed, which worked perfectly.

last monday was when i actually setup my little test switched network. over that previous weekend i installed the squid proxy on my home adsl network firewall to see how well tf worked. things worked pretty well – no file read errors, at least. (i’ll have to revisit some caching issues later.)

one obstacle i overcame was that the ethernet adapter in moby’s docking station is only a 10 meg adapter which would not run in promiscuous mode – needed to capture packets not specifically destined for moby. using a usb 10/100 adapter i had lying around did the trick – linux detected the adapter as soon as i plugged it in!

i’m not an expert in tcp/ip so it took me a bit to figure out the snort output, but it wasn’t to tough since i’ve done some tcpdump stuff before. i did a capture using the proxy and one using the firewall client to get a “bad” dump and a “good” dump of the data.

after finding the packets that were been returned to the client, i noticed that after all the errors, one of the trailing packets contained the R flag. the R flag is to reset the connection. that was a big clue to the problem.

then I started to analize the http headers. i knew that the applet was having no problem loading static xml files. the problem arose when we issued a soap request that the request processor servlet would then send a dynamic response. so what did the headers show? well, the static files all had the standard fair that apache sends back, including “connection: keep-alive”. guess what the servlet’s http headers had, yup: “connection: close”.

this was telling the applet to close the connection. so what i’m assuming is that, since the request is actually being submitted by the proxy server, the request that gets back to the applet closes before the applet closes its input stream – even when it looks like the whole xml response is there.

so from there we tried coding the servlet to put the keep-alive headers in, but all we got back was a dual connection entry: “connection: keep-alive, close” which would close the connection still. so it was off to google to do some more searching.

since i knew what i was looking for, i found this cool article on keep-alives and java. what i did not know was that servlets put “connection: close” headers if the response is greater than 4k and you don’t send a content length header. once we knew that, we added one line of code to the servlet to send back the content length and, bam!, it worked! ahhh!

the boss bought us a 12 pack of beck’s!

one thing i still want to investigate is how proxies work at the tcp/ip level. isa seems to send http 1.0 headers (”via” header) instead of http 1.1 headers that ie sends, so i want to know what problems this will cause.

Categories: web Tags:
  1. July 16th, 2003 at 11:46 | #1

    Any idea WHY ISA sends those 1.0 headers? This has been puzzling me, too?

    Thanks…

  2. July 16th, 2003 at 13:12 | #2

    I emailed privately to Bill, but if it helps anyone:

    Bill,

    Unfortunately , I did not get a chance to delve further into ISA and it’s strange behaviors. One idea I had was that since (realizing from a post on slashdot.org) keep alive is deprecated in http 1.1, maybe ISA sees the keep alive headers and reverts to a 1.0 connection. I haven’t looked too much into this, but the original http 1.1 rfc (rfc2068 – http://www.w3.org/Protocols/rfc2068/rfc2068) section 19.7.1, Compatibility with HTTP/1.0 Persistent Connections, might be a place to look. I keep a copy the http 1.1 rfc (2616) on hand at all times!

    Sorry I can’t be of much help, but thanks for the comment!
    -Pat

  3. July 17th, 2003 at 15:37 | #3

    Bill replied to me saying he found the following post on the ISA newsgroup from a MSFT dude:


    ISA Server presents itself as an HTTP 1.1 server to browsers, and as an HTTP
    1.0 client to web servers. This lets the ISA Server web proxy maintain a
    high degree of compatibility with both web browsers (including modern ones)
    and web servers (including legacy servers).

    Not a good implementation of a proxy server, if you ask me!

Comments are closed.