News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
a frenqent but odd fault? Why?  
by javaduke [cmuwyb at hotmail dot com]
posted on 2004/10/17

Version 1.0.13.709
private string DoAuthCommand(string cn,bool left)
{
// send the AUTH command
sendCommand("AUTH SSL","2",left); //if the server accepted our command, start the SSL/TLs connection
SecurityOptions options = new SecurityOptions(SecureProtocol.Ssl3|SecureProtocol.Tls1);
options.AllowedAlgorithms = SslAlgorithms.SECURE_CIPHERS;
options.CommonName = cn;
options.Left=left;
options.VerificationType = CredentialVerification.Manual;
options.Verifier = new CertVerifyEventHandler(OnVerify);
if(left) FtpFunction.leftSocketInfo.SecureSocket.ChangeSecurityProtocol(options);
else FtpFunction.rightSocketInfo.SecureSocket.ChangeSecurityProtocol(options);
return null;
}

The above code managed the Auth SSL connection the server.
Why i put that code in a thread.
Most of the time, it does not work.
It seems, when the code send hello to the server, it fails to retrieve the response of the server. so the code stop there.

but when i put that code by using invoke method.
such as:this.Invoke(new UpdateListView(DoAuthCommand),new object[]{socketInfo.ip,socketInfo.left});
in this case, Most of time, it works correctly. but in some case, it fails just like the above.

I tested that the question is the ServerSocket just say hello to the server, but could not get a response.

I try to connect a CuteFTP 2.0 SSL Server.

Who can help me solve the problem or give me some suggestions.

by javaduke [cmuwyb at hotmail dot com]
posted on 2004/10/19

The Above question has been solved,
it related to the socket.beginreceive method.
To make to the program go correctly, you must make sure after you initial a securesocket then call the socket.beginreceive method.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.