Build 3428: Faster upload/download and FIPS 140-2 mode support in SFTP and lots of other enhancements

  |   Lukas Pokorny

Faster uploads and downloads in SFTP

We are now using a new approach in file download and upload methods that take advantage of the SFTP protocol's ability to queue multiple commands. By keeping the server's command queue full all the time, a better transfer speed can be achieved. Also, several other changes that further enhance the transfer speed were included, making the SFTP component faster than ever.

FIPS 140-2 mode in SFTP

This was one of the most requested features recently. When using Rebex SFTP on a machine where only certified FIPS 140-2 algorithms are allowed, a FIPS 140-2 mode is enabled and non-compliant algorithms are switched off. This mode can also be enabled manually by referencing Rebex.Security.dll and setting the Rebex.Security.Cryptography.CryptoHelper.UseFipsAlgorithmsOnly property to true.

At the moment, this feature is only available in Rebex SFTP - if you would like to one of the other components to support it as well, please let us know!

Transfer compression support in SFTP

Well, kind of. The problem is that the .NET's compression support is not low-level enough to be used by SFTP's underlying SSH protocol. Even though there are several third-party ZLIB implementations that are usable, these come under a BSD-like license and require the full text of the license to be included with any product which uses them, which effectively makes it unusable for us because we don't want to force our clients into this, unlike several other SFTP component vendors who do and try to hide the fact.

So until we write a custom implementation of ZLIB, we decided to offer a .NET ZLIB library based on a port of a JCraft's BSD-style-licensed JZLib as a separate download that can be used together with Rebex SFTP to make it possible to use compression. The decision whether to include a library under a BSD-style license is therefore up to you! Another blog post will explain how this can be used to enable compression support in Rebex SFTP.

Lots of enhancements in Rebex Mail

The new SmtpConfiguration class makes it possible to read SMTP settings from application configuration file's /configuration/system.net/mailSettings/smtp node, making it easier to store your SMTP server configuration. Gmail's XLIST IMAP command is supported - this makes it possible to detect which folder is which even if they are using localized names. There are lots of other enhancements as well that substantially increase server compatibility - check out the full list below.

Complete list of changes:

  • SFTP: Upload and download speed enhanced a lot using the pipelining approach.
  • SFTP: Upload and download buffer size changed from 32K to 28K because the original size resulted in two packets being sent.
  • SFTP: Added support for transfer compression through a plugged-in library.
  • SFTP: UTF-8 encoding is used by default for WS _FTP server.
  • SFTP: Fixed a misleading error message that occurs when both password and public key authentication is required by the server but the clients only supply one of the credentials.
  • SFTP: Added several workarounds for CoreFTP server's SFTP implementation that suffers from numerous bugs such as missing file attributes or half-working SSH _FXP _REALPATH command.
  • SFTP: Fixed a bug in GetFiles and PutFiles method that caused a wrong path to be used when a filename only was specified or when a root path was specified.
  • SCP: Compatibility enhancements in Scp object's PutFile method.
  • SCP: Added a workaround for Bitvise's SCP that closes the SCP channel too early.
  • FTP: Disposing Ftp object from another thread while an operation is in progress no longer causes NullReferenceException and other similar errors to occur in the operation thread.
  • FTP: Better URL handling in the Connect method (although it is hostname-only by design, lot of users actually pass URLs to it).
  • FTP: Enhanced logging of incoming connection in active mode.
  • FTP: Added a workaround for WS _FTP that requires MLST/MLSD arguments to be quoted if they contain spaces.
  • FTP: Added FtpException.Transferred property as a replacement for the misspelled FtpException.Transfered property.
  • FTP: Fixed a bug in GetRemoteChecksum method that caused it not to work for filenames that contain space characters.
  • FTP: Fixed a bug that caused FtpException's BytesTransferred property not to be set for exceptions thrown by asynchronous methods.
  • FTP: Fixed a bug in MODE B transfer mode that might cause an improper block length to be received in rare circumstances.
  • FTP: Fixed a bug in GetFiles and PutFiles method that caused a wrong path to be used when a filename only was specified or when a root path was specified.
  • MIME: Added a workaround for broken Date headers to MailMessage class - when an unparsable Date header is encountered, the date value from the topmost Received header is used instead.
  • MIME: Fixed a bug in the TNEF parser that caused an exception to be thrown when parsing rich text bodies that contain zero characters (which are perfectly legal for RTF, unfortunately).
  • MIME: MailDateTime class now supports implicit conversion from DateTime.
  • MIME: Long file name support for attachments added to TNEF (winmail.dat) parser.
  • POP3: GetMessageList no longer fails on duplicate unique IDs because RFC 1939 actually allows them.
  • POP3: Disposing Pop3 object from another thread while an operation is in progress no longer causes NullReferenceException and other similar errors to occur in the operation thread.
  • POP3: GetMessageList or GetMessageInfo methods enhanced to make them compatible with servers that return the first message line as well when retrieving headers. In previous versions, this might have occasionally lead to parsing errors.
  • POP3: Enhanced GetMessageHeaders to always retrieve the headers only
    • on some servers, it used to retrieve the first line of the message as well.
  • IMAP: Fixed a bug in Imap.SelectFolder method that threw ArgumentOutOfRangeExceptions on some servers.
  • IMAP: Imap.SelectFolder now accepts an empty folder name because some servers (Zarafa) use it for the root folder.
  • IMAP: Added ImapMessageInfo.GetRawHeaders method.
  • IMAP: Fixed a bug in Imap.GetMessageHeaders method that caused it to download the whole message.
  • IMAP: SelecteFolder, UnselectFolder and Disconnect methods no longer purge messages marked as Deleted in the currently selected folder. New overload of UnselectFolder method was added that makes it possible to purge the messages when needed.
  • IMAP: Headers are now fetched using BODY.PEEK[HEADER] instead of RFC822.HEADER to improve IMAP server compatibility.
  • IMAP: Added a new ImapOptions.UsePeekForGetMessage option to make it possible to avoid automatically marking downloaded messages as read.
  • IMAP: StoreRawMessage method added to make it possible to upload a raw message from a stream without parsing it.
  • IMAP: Gmail's XLIST command is used instead of LIST by default and a new property ImapFolder.Purpose was added to make it possible to detect which folder is which regardless their national name.
  • IMAP: Added workaround for IMAP servers that return NIL as a folder delimiter (slash is used instead).
  • IMAP: Added workaround for servers that return the same folder name twice for unknown reasons.
  • IMAP: Invalid IMAP response lines such as " * AVK-VIRUS-CHECK: 1" are now ignored.
  • IMAP: Added workaround for broken IMAP servers that use their default charset where modified UTF-7 is required.
  • IMAP: Disposing Imap object from another thread while an operation is in progress no longer causes NullReferenceException and other similar errors to occur in the operation thread.
  • IMAP: Added ImapMessageIfo.GetRawHeaders method.
  • IMAP: Added MimeHeader.DecodeMimeHeader method.
  • IMAP: Added workaround for Exchange 2007's IMAP server that is unable to return the proper structure of multipart/signed messages.
  • SMTP: Added support for RFC 1870 - message size declaration.
  • SMTP: Added SmtpConfiguration class that makes it possible to read SMTP settings from application configuration file's /configuration/system.net/mailSettings/smtp node.
  • SMTP: Fixed a bug that caused an exception when sending a message with embedded message entity using an 8bit content transfer encoding through a server that doesn't support 8bit MIME.
  • SMTP: Disposing Smtp object from another thread while an operation is in progress no longer causes NullReferenceException and other similar errors to occur in the operation thread.
  • Terminal: Poll method added into IShellChannel.
  • Terminal: Fixed a bug that caused the Enter key not to be echoed when local echo is on.
  • TLS/SSL: Exception thrown by the certificate verifier because of certificate hostname mismatch is more descriptive.
  • TLS/SSL: Added a workaround for vsftpd that occasionally leaks unencrypted error messages while TLS/SSL is in use, which causes an error when the client tries to decode them as proper TLS/SSL messages.
  • TLS/SSL: Fixed a bug that could cause a deadlock when closing a socket from one thread that is currently sending data using another thread.
  • TLS/SSL: Fixed possible NullReferenceException in TlsSocket class.
  • TLS/SSL: BeginSend and BeginReceive methods work again.
  • SSH Core: Added FIPS 140-2 compliant mode that is automatically enabled on systems where only compliant algorithms are allowed.
  • SSH Core: Added a new exception status - PasswordChangeRequired - that is used when a password change is required before authentication can be successfully completed.
  • Security: .PFX/P12 private key file loading support for Windows Mobile 5 and newer