|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-11-15 16:04 UTC] trevor at blubolt dot com
Description: ------------ Starting with libssh2 >= 1.2.8 the zlib compression method is not enabled for sessions by default and must instead be enabled with a call to http://www.libssh2.org/libssh2_session_flag.html This prevents connections to servers which only accept zlib compressed messages. For reference the error reported is "Error starting up SSH connection(-5): Unable to exchange encryption keys". Please find attached a quick patch against release 0.11.3 to do so for all new sessions created. This seemed like the best approach to me as from what I can tell this now mimics the old expected behaviour. Patchesenable_compression_add_new_option (last revision 2014-08-28 14:01 UTC by phpbugs2012 at joern dot heissler dot de)enable-compression.patch (last revision 2012-11-15 16:04 UTC by trevor at blubolt dot com) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
In my particular use case the server in question is managed by a third party and handles sending and receiving large large text files via sftp. These compress well so I can understand the rationale for only allowing zlib connections. That said, I'd have no particular problem with compression not being available by default. As you state for the majority of use cases it doesn't make any sense. Perhaps including "zlib" in the list of compression methods to advertise via the ssh2_connect methods parameter should be enough to trigger setting the new libssh2 session flag? That is to say the default compression methods could default to "none" with the following code being sufficient to enable zlib compression: ssh2_connect( "ssh.example.com", 22, [ "client_to_server" => ["comp" => ["zlib"]], "server_to_client" => ["comp" => ["zlib"]] ] );