Jump to content
EugeneK

Disconnecting after failed SSL handshake

Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×