Forum Discussion
[iRule] to trim hex value and send it to pool
I don't have an environment like yours to test, but you can absolutely replace the payload. Here's how it looks in my lab to an HTTPS VIP. I'm changing the first character in the request payload (GET to HET):
when CLIENTSSL_HANDSHAKE {
SSL::collect
}
when CLIENTSSL_DATA {
binary scan [SSL::payload] H* hex
log local0. $hex
set hex2 [string replace $hex 0 1 "48"]
log local0. $hex2
Binary format the resulting string
set bin [binary format H* $hex2]
SSL::payload replace 0 [SSL::payload length] ""
SSL::payload replace 0 0 $bin
SSL::release
}
Your mileage is going to vary based on the underlying application protocol itself. For instance, some protocols encode a length value into the packet or (like ASN.1) for individual values, so you may need to change that if you're going to be sending less data than the client generated. The amount you collect is going to need to be the amount you replace (unless you change whatever length value exists). In the above example, I'm collected the entire payload and then replacing the entire payload.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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