Even though SSH.NET supports compression, we do not ship with compression enabled.
We have a (stub-like) implementation of zlib compression in place which consists of the following classes:
- Renci.SshNet.Compression.Compressor
- Renci.SshNet.Compression.Zlib
- Renci.SshNet.Compression.ZlibOpenSsh
- Renci.SshNet.Compression.ZlibStream
The implementation of ZlibStream is commented out, and without this compression is of course broken.
I wasn't actively invoked in SSH.NET when this was decided, but I suppose this was done to avoid an extra dependency on a zlib library.
I see the following options for completing support for zlib (de)compression:
| Option |
Advantages |
Disadvantages |
| ZipLibStream |
Supports RFC1950. |
Only available in .NET 6+. |
| DeflateStream1 |
Supports wide range of TFMs. |
Doesn't support RFC1950 header and trailer bytes. |
| Third-party zlib library2 |
Possible support wide range of TFMs. |
Licensing. |
1 We'll have to verify whether the lack of support for TFC1950 is a showstopper for DeflateStream.
2 If we decide to use a third-party library, we should move the zlib compression support to a separate library/assembly/nuget.
Note:
The difference between zlib and zlib@openssh.org is that the latter delays compression until after user authentication.
Even though SSH.NET supports compression, we do not ship with compression enabled.
We have a (stub-like) implementation of zlib compression in place which consists of the following classes:
The implementation of ZlibStream is commented out, and without this compression is of course broken.
I wasn't actively invoked in SSH.NET when this was decided, but I suppose this was done to avoid an extra dependency on a zlib library.
I see the following options for completing support for zlib (de)compression:
1 We'll have to verify whether the lack of support for TFC1950 is a showstopper for DeflateStream.
2 If we decide to use a third-party library, we should move the zlib compression support to a separate library/assembly/nuget.
Note:
The difference between zlib and zlib@openssh.org is that the latter delays compression until after user authentication.