I'm trying to intercept grpc traffic via TLS and mutate request bodies before sending them on to the destination. I'm decompressing payloads, de-serializing them, mutating them, then compressing them again, setting the new request.Body and then setting the Content-Length header.
I'm curious if this is something that's supported since I haven't seen any examples of how to do this and I'm continuously running into the following error message.
2023/11/18 23:20:09 [014] WARN: Cannot read TLS response from mitm'd server net/http: HTTP/1.x transport connection broken: http: ContentLength=17918 with Body length 17858
Even though I set the Content-Length header to 17858. Does the header get dropped somewhere?
Any help would be greatly appreciated!
Thanks!
FIXED
You have to set the ContentLength property on the request object, not just the header.
I'm trying to intercept grpc traffic via TLS and mutate request bodies before sending them on to the destination. I'm decompressing payloads, de-serializing them, mutating them, then compressing them again, setting the new request.Body and then setting the Content-Length header. I'm curious if this is something that's supported since I haven't seen any examples of how to do this and I'm continuously running into the following error message.
Even though I set the Content-Length header to 17858. Does the header get dropped somewhere?
Any help would be greatly appreciated! Thanks!
FIXED
You have to set the ContentLength property on the request object, not just the header.