EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Closing SSL connection

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#9451
Posted: 03/30/2009 09:19:34
by Sandeep Mohan (Standard support level)
Joined: 02/25/2009
Posts: 46

I am using a ElSecureClient. When i want to disconnect the SSL connection i use ElSecureClient.Close.
The client at this point is not sending the proper close_notify to the server. The Server throws an ERROR.
I have written other clients which dod not throw an error while closing. What should i do to properly close the SSL connection without the server returning an error?
#9454
Posted: 03/30/2009 14:39:40
by Sandeep Mohan (Standard support level)
Joined: 02/25/2009
Posts: 46

This problem exists in the sample programs as well. Figured out the issue.
#9455
Posted: 03/30/2009 15:23:23
by Eugene Mayevski (EldoS Corp.)

Do I understand right that the issue was solved? Can you please tell us what the cause of the problem was?


Sincerely yours
Eugene Mayevski
#9475
Posted: 03/31/2009 05:36:00
by Sandeep Mohan (Standard support level)
Joined: 02/25/2009
Posts: 46

In the sample code provided, the ClientSocket.close is called after the ElSecureClient.close in the Disconnect subroutine. I removed the call to the ClientSocket.Close in the Disconnect subroutine, and modified the code under ClientSocket_Close() event instead of calling Disconnect again. That fixed it.

Code
Sub CloseConnection()
   If Active Then
       If Client.Active Then
           Client.Close
       End If
       'Call ClientSocket.Close
       Active = False
       ReceiveFlag = False
       Text3.Text = Text3.Text + vbCrLf + "Disconnected"
   End If
  
End Sub

Private Sub ClientSocket_Close()
    ClientSocket.Close
End Sub
#9477
Posted: 03/31/2009 06:33:41
by Eugene Mayevski (EldoS Corp.)

Yes, that's it. I didn't have code at hand so I couldn't be sure that my answer would be correct, but I suspected that too early socket closing was the problem.


Sincerely yours
Eugene Mayevski
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 1125 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!