2

I need to automatically transfer an xml file from server A over internet to a server B. Ftp works fine, but should I be use a message queue instead?

It should be secure in the order that I won't lose messages and be able to log what is transferred.

Makach
  • 7,435
  • 6
  • 28
  • 37
  • 2
    Secure against what? Secure against network failure, cryptographically secure, or some other form of safety? – MSalters Sep 15 '10 at 11:59
  • From your comment on my answer, it seems you didn't tell us all your requirements. What other limitations are there, besides "server B (the client machine) won't allow any http or https connections"? – Piskvor left the building Sep 15 '10 at 12:51
  • @Piskvor thats it afaik. The question contains the requirements, ftp or message queue. – Makach Sep 15 '10 at 17:43

3 Answers3

2

Use sftp whenever possible.

halfdan
  • 33,545
  • 8
  • 78
  • 87
2

You could use a message queue as well but not to transfer the files, just for keeping a queue of the files to be transferred. Then you can write a Service who uses sftp, https, ssh, or whatever other secure method to transfer the files. There are plenty of options. A common scenario to use is: - Write a file to a given folder and a message to the message queue. - The web service will be polling the message queue who will have a message with the filename to be transferred. If there is a file, use SECURE METHOD CHOSEN (see the links below), and do the transfer.

Well, you could simply avoid using message queue and use a secure client to connect to the server B from server A and do the transfer, here are some links that can help you:

How do I upload a file to an SFTP server in C# / .NET?

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/bee2ae55-5558-4c5d-9b5c-fe3c17e3a190

http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/f5d22700-552f-4214-81f5-fa43bfcc723d

Hope that helps

Community
  • 1
  • 1
Ramon Araujo
  • 1,743
  • 22
  • 31
0

Use a POST over HTTPS - an implementation is available on every imaginable platform.

Of course, you need to check certificate validity, but this is also a part of the protocol itself; your part is to keep the certificates correct and secure.

Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222