DataScript: avi.ssl.client_cert_verify_error_string

DataScript

Function avi.ssl.client_cert_verify_error_string()
Description This API accepts a verify error code and returns an error string associated with that error code
Events VS_DATASCRIPT_EVT_SSL_HANDSHAKE_DONE
VS_DATASCRIPT_EVT_HTTP_REQ
VS_DATASCRIPT_EVT_HTTP_REQ_DATA
Parameters One integer argument as client cert verify error()
Returns This DataScript function returns error strings given the verify error code from OpenSSL verify documentation to understand the specific meaning of these error codes returned by SSL stack.
Example

if avi.ssl.server_name() == "secure.example.com" then 
    avi.ssl.set_pki_profile(avi.CLIENT_VERIFY_REQUIRE, "pkiprofile-ca", avi.AUTHENTICATE_ONLY_ONCE)
    avi.ssl.renegotiate()
    verify_err, error_code = avi.ssl.client_cert_verify_error()
    if  verify_err == 0 or (verify_err == 2 and avi.ssl.client_cert_verify_error_string(error_code) ~= 'X509_V_OK') then
        avi.http.close_connection()   
    end
end