SSL:peer_cert(str)
Returns the peer certificate in different formats.
Syntax
SSL:peer_cert(str);
Arguments
| Name | Description |
|---|---|
|
str |
A string which specifies the certificate format. |
Events
Applicable in the following events:
-
CLIENTSSL_HANDSHAKE
-
SERVERSSL_HANDSHAKE
-
CLIENTSSL_RENEGOTIATE
-
SERVERSSL_RENEGOTIATE
Example
when CLIENTSSL_HANDSHAKE {
cder = SSL:peer_cert(“der”); --for remote leaf certificate, the input parameter can be “info” or “der” or “pem”
if cder then
hash = sha1_hex_str(cder)
debug(“whole cert sha1 hash is: %s\n”, hash)
end
}
Supported Version
FortiADC version 5.0.x and later.