EugeneK 19 Posted October 24, 2023 Hi There is following code in the end of TCustomSslWSocket.TriggerSSLHandshakeDone Disconnect := FALSE; if Assigned(FOnSslHandshakeDone) then FOnSslHandshakeDone(Self, ErrCode, FSslPeerCert, Disconnect); if Disconnect and (ErrCode = 0) then Close; I wonder why last two lines not just if Disconnect then Close; User can't force disconnect on failed handshake? Share this post Link to post
Angus Robertson 574 Posted October 25, 2023 You have shown an extract from a long function, if there was an error the connection will be disconnected anyway. The handshake event is called merely to allow the application to know there was a failure and report it to the end user. Angus Share this post Link to post