Initiate secure TLS (SSL) connection to a specified host via TLS Handshake protocol. During Handshake, a client and a server agree on connection parameters: applied protocol version and data encryption method.
[in] Address of a host a secure connection is established with.
Returns true if successful, otherwise false.
Before a secure connection, the program should establish a standard TCP connection with the host using SocketConnect.
If secure connection fails, the error 5274 (ERR_NETSOCKET_HANDSHAKE_FAILED) is written to _LastError.
There is no need to call the function when connecting to the port 443. This is a standard TCP port used for secure TLS (SSL) connections.
The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If calling from an indicator, GetLastError() returns the error 4014 – "Function is not allowed for call".