private void SendFile(UploadData credential, FileStream fstream) { TcpClient client = new TcpClient(credential.ip, credential.port); SslStream ssl = new SslStream( client.GetStream(), false, new RemoteCertificateValidationCallback(AuthenticationPrimitives.ValidateServerCertificate), null, EncryptionPolicy.RequireEncryption); ssl.AuthenticateAsClient(credential.ip, null, System.Security.Authentication.SslProtocols.Tls12, false); ssl.Write(UsefullMethods.GetBytesFromString(credential.token)); fstream.CopyTo(ssl); ssl.Close(); fstream.Close(); }
private void resetVersion(UploadData ud,FBVersion v) { string filename = Path.GetTempFileName(); UsefullMethods.ReceiveFile(ud.ip, ud.port, ud.token, filename); String pathFiles; List<Instruction> instructionList = UsefullMethods.ExtractInstructions(filename, out pathFiles); foreach (Instruction i in instructionList) { ExecuteInstruction(i, pathFiles); } CleanUpDir(v.root,""); StartSync(); }