Forum Discussion

Genna_Reingold's avatar
Genna_Reingold
Icon for Nimbostratus rankNimbostratus
Jun 01, 2021

How to use literals starting with "$" in iRule

Hi,

I need to pass client certificate to WebSphere so the application can perform SSL based authentication. I following this article https://support.f5.com/csp/article/K95338243

However in WebSphere App Server the headed for client certificate is $WSCC. But if I code iRule like this

when HTTP_REQUEST {

  HTTP::header insert $WSCC [b64encode [SSL::cert 0]]

}

 

$WSCC is treated as a variable WCSS and the rule is broken

 

How do I get around this issue?

 

Thanks

Genna

 

2 Replies

  • Hi Genna,

    you can escape the '$' character with a '\'. This should work:

    when HTTP_REQUEST {
        HTTP::header insert "\$WSSC" [b64encode [SSL::cert 0]]
    }

    KR

    Daniel

  • to prevent variable substitution, you can replace double quotes by curly braces.

    when HTTP_REQUEST {
        HTTP::header insert {$WSSC} [b64encode [SSL::cert 0]]
    }

    Stan