Forum Discussion

Ruggerfly1's avatar
Ruggerfly1
Icon for Nimbostratus rankNimbostratus
Jun 27, 2017

IRULE to search Certificate Subject and Set Username.

Good Afternoon,

I'm trying to get an IRULE to use the Client SSL profile Request handshake to filter the cert and subject. IRULE was crafted-reused from a few other DevCentral Post.

Here's where I'm at: Error 4: error: ["unexpected end of arguments;expected argument spec:CERTIFICATE"][X509::subject]

when CLIENTSSL_CLIENTCERT {

  if {([SSL::cert 0] eq "") or (![X509::subject] contains "irene")} {

   Reset the connection
    reject

} else {

set subject_all [X509::subject [SSL::cert 0]] log "Subject: $subject_all" binary scan [md5 $subject_all] H* user_hash log "$user_hash" } }

What am I missing?

Cheers!

1 Reply

  • eey0re's avatar
    eey0re
    Icon for Cirrostratus rankCirrostratus

    X509::subject needs to be passed the certificate from which to extract the subject, and is missing from your first line.

    Try:

    if {([SSL::cert 0] eq "") or (![X509::subject [SSL::cert 0]] contains "irene")} {