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. |