SSL:sni()
Returns the SNI or false (if no SNI).
Syntax
SSL:sni();
Arguments
N/A
Events
Applicable in the following events:
-
CLIENTSSL_HANDSHAKE
-
SERVERSSL_HANDSHAKE
-
CLIENTSSL_RENEGOTIATE
-
SERVERSSL_RENEGOTIATE
Example
when CLIENTSSL_HANDSHAKE {
debug("client handshake\n")
cc=SSL:sni();
debug("SNI: %s \n",cc);
}
Result:
Enable sni in client-ssl-profile
config load-balance client-ssl-profile
edit "csp"
set client-sni-required enable
next
end
-
Client sends HTTPS request without SNI:
[root@NxLinux certs]# openssl s_client -connect 5.1.1.100:443 Debug output: Client handshake SNI: false
-
Client sends HTTPS request with SNI:
openssl s_client -connect 5.1.1.100:443 -servername 4096-rootca-rsa-server1 debug output : client handshake SNI: 4096-rootca-rsa-server1
Supported Version
FortiADC version 5.0.x and later.