Forum Discussion

Eric_Sutton_288's avatar
Eric_Sutton_288
Icon for Nimbostratus rankNimbostratus
Oct 27, 2016

iRule error undefined procedure

I received an error when attempting to create this iRule. The error was "undefined procedure &160][ ]". When I searched the forums I found other posts where the error indicated an invalid command; although I do not notice an invalid command in this iRule. Any suggestions would be helpful.

 

when HTTP_REQUEST { if { [SSL::cert count] > 0 } then { set clientcert [SSL::cert 0] set clientdn [X509::subject [SSL::cert 0]] set clientserial [X509::serial_number [SSL::cert 0]] HTTP::header insert XClientCert [b64encode $clientcert] HTTP::header insert XClientDN $clientdn HTTP::header insert XClientSerial $clientserial } }

 

  • Hi Eric,

    the iRule looks very valid. Could be the case that a leading or trailing line may cause this issue...

    So clear the content of your existing iRule using STRG+A -> STRG-X and then STRG-C -> STRG-V the iRule below...

    when HTTP_REQUEST { 
        if { [SSL::cert count] > 0 } then { 
            set clientcert [SSL::cert 0] 
            set clientdn [X509::subject [SSL::cert 0]] 
            set clientserial [X509::serial_number [SSL::cert 0]] 
            HTTP::header insert XClientCert [b64encode $clientcert] 
            HTTP::header insert XClientDN $clientdn 
            HTTP::header insert XClientSerial $clientserial 
        } 
    }
    

    Cheers, Kai