SSL:disable()
Disables SSL processing on either the client or server side when non-SSL traffic is expected or desired.
Returns Boolean true if successful, otherwise, returns Boolean false.
This command only disables the SSL function on the current virtual server, and does not change any settings of the virtual server.
Before executing this command, ensure that HTTP connections are able to work in your virtual server environment.
Syntax
SSL:disable([side_name]);
Arguments
| Name | Description |
|---|---|
|
side_name |
A Lua string to indicate on which side the SSL will be disabled. You can input either of the following:
This argument is optional. If it is not specified, FortiADC will determine which side to use based on the event where this API is called. |
Events
Applicable in the following events.
Client side:
-
TCP_ACCEPTED
Server side:
-
HTTP_REQUEST
-
BEFORE_AUTH
-
AUTH_RESULT
-
PERSISTENCE
-
POST_PERSIST
-
SERVER_BEFORE_CONNECT
Examples
--Client side must be TCP ACCEPTED
when TCP_ACCEPTED {
debug("------> TCP accepted begin:\n");
srcIP = IP:client_addr();
srcPort = IP:client_port();
debug("------> Client ip:port %s:%s\n", srcIP, srcPort);
destIP = IP:local_addr();
destPort = IP:local_port();
debug("------> Local ip:port %s:%s\n", destIP, destPort);
if tonumber(destPort) == 80 then
ret = SSL:disable("clientside");
if ret then
debug("------> SSL disable clientside successfully.\n");
else
debug("------> SSL disable clientside failed.\n");
end
else
debug("------> SSL disable clientside skipped.\n");
end
debug("------> TCP accepted end.\n");
}
--Server side can be called within many events
when HTTP_REQUEST {
debug("------> HTTP Request begin:\n");
srcIP = IP:client_addr();
srcPort = IP:client_port();
debug("------> Client ip:port %s:%s\n", srcIP, srcPort);
destIP = IP:local_addr();
destPort = IP:local_port();
debug("------> Local ip:port %s:%s\n", destIP, destPort);
if tonumber(destPort) == 80 then
ret = SSL:disable("serverside");
if ret then
debug("------> SSL disable serverside successfully.\n");
else
debug("------> SSL disable serverside failed.\n");
end
else
debug("------> SSL disable serverside skipped.\n");
end
debug("------> HTTP Request end.\n");
}
Supported Version
FortiADC version 7.4.3 and later.