Shane_Benting_5
May 23, 2008Nimbostratus
Rewriting POST Data
I have an application where we offloaded the SSL onto the LTM. The client will initially do a GET to pull a WSDL and we rewrite the response via a stream profile so the URL sent to the client is https. However, when the client then POSTs their data to the https URL, the application is confused since it received the data over what it thought was HTTP.
Is there an easy way to rewrite the POST data? I haven't been able to find any similar examples searching the forums. I have been able to put together the below iRule, but it seems to stop functioning after a while and blocks all HTTP traffic (I haven't even been able to verify that it works). I also get the feeling that this is a resource-intensive way to rewrite the data. It seems like there must be a better solution.
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
regsub -all "https://www.example.com" [TCP::payload] "http://www.example.com" newdata
TCP::payload replace 0 [TCP::payload length] $newdata
TCP::release
}