Forum Discussion
Doug_Lohf_88372
Nimbostratus
Oct 07, 2005Encrypt HTTP body?
I know this sounds strange but is it possible to only encrypt only the body of an http packet with an iRule? The client at the far end is not a browser but a custom client.
unRuleY_95363
Oct 11, 2005Historic F5 Account
Try something like this:
when HTTP_REQUEST {
Don't allow data to be chunked
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
when HTTP_RESPONSE {
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 4294967295
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
when HTTP_RESPONSE_DATA {
set encrypted [b64encode [AES::encrypt "passphrase" [HTTP::payload]]]
HTTP::payload replace 0 [HTTP::payload length] $encrypted
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects