What are you trying to accomplish with the changes to the iRule?
If the application (or LTM) sets an arbitrary HTTP header in a response, the client will not include that same header in a subsequent request. You could try setting a cookie with the subject DN as the cookie value. The client would automatically include the cookie in requests assuming they support cookies. But a malicious client could modify the cookie value. So you could encrypt the cookie value in responses and decrypt it on requests. Another option would be to store the cert information in the session table, using the session command (
Click here). There are examples of this in the Codeshare:
Insert Cert In Server Headers
http://devcentral.f5.com/wiki/default.aspx/iRules/InsertCertInServerHeaders.html
Aaron