Forum Discussion

Janek_42109's avatar
Janek_42109
Icon for Nimbostratus rankNimbostratus
Jan 22, 2016

ASM - XML Profile Properties : import server certificate failed

Hello all, On my ASM policy i'm trying to up upload a server certificate on the Web Services Security Configuration in the XML Profile Properties. I have the following error "Validation failed. Please upload valid .PEM file"

 

The certificate that I tried to upload contained the private and the public key in base64 format. When using the following openssl command "openssl x509 -noout -text -in certificate.pem", i have the right output with all the certificate details.

 

I was also following the manual : https://support.f5.com/kb/en-us/products/big-ip_asm/manuals/product/asm-implementations-11-6-0/18.html

 

I don't know where is the problem here.

 

Can anyone had a similar issue ?

 

Thanks

 

5 Replies

  • Janek, you might open the PEM file in nano or vi and ensure there is no leading or trailing whitespace and that the file wraps at 64 characters. It must have the correct begin and end headers, and unix line endings also.
  • Hello Chris, I was checking the file as mentioned but I still had the same issue. I found a workaround using iRule
  • Would you be willing to post your irule workaround so the community can benefit? Thank you.
  • Hello Chris,

    Actually there are Two iRules. To explain the context, in my case i have several URIs that for each of them have a diffrent web service and protected by different WDSL. I need to restrict the access to those Web Service specially based on the client certificate.

    On the SSL Client Profile i filter the connection on a specific public AC. Then with the first iRule based on the serial of client certificate, i let the connection go on if it match the serial on the DataGroup. I also create a specific header to pass the client certificate serial. I will use again this header in the second iRule.

    when CLIENTSSL_CLIENTCERT {
      set cert [SSL::cert 0]
      set sn [X509::serial_number $cert]
      set subject [X509::subject $cert]
      set issuer [X509::issuer $cert]
      set version [X509::version $cert]
    }
    
    when HTTP_REQUEST {
    HTTP::header insert NSClientCert [X509::serial_number $cert]
          if { ([matchclass $sn contains SSL_CLIENT])} {
             Accept the client cert
             log local0. "Client Certificate Accepted: $sn"
          } else {
             log local0. "No Matching Client Certificate Was Found Using: $sn"
             reject
          }
       }
    

    The second iRule filter the URI based again on the serial of the client certificate. One client may or may not be allowed to one or more Web Service. There are also DataGroup created to match the client certificate serial for each Web Service on which client are authorised to access or not.

    when HTTP_REQUEST {
    set ClientCertSerial [HTTP::header value NSClientCert]"
    switch -glob [string tolower [HTTP::uri]] {
           
            "/foo/*" {  
    if { ([matchclass $ClientCertSerial contains SSL_CLIENT_FOO]) } {       
                HTTP::uri [string map {"/foo/" "/"} [HTTP::uri]]
                pool FOO
                }
           }
                       
            "/bar/*" {      
    if { ([matchclass $ClientCertSerial contains SSL_CLIENT_BAR]) } {   
                HTTP::uri [string map {"/bar/" "/"} [HTTP::uri]]
                pool BAR
                }
           }                       
                
            default {   
            log local0. "--> default : [HTTP::uri]"
                                 }
    }
    } 
    

    I realize that there might be an easiest way to do it but well, it works like this 🙂