ethrbunny has asked for the wisdom of the Perl Monks concerning the following question:

I wrote a SOCKET server using OpenSSL 0.9.8g. Supposedly it looks for some sort of header during negotiation to determine whether or not to compress the data. Its done by default if the appropriate message is sent from the client. My client will (probably) be IO::Socket::SSL. Im going to be using this server to pass many Gb of data over the wire and would like to see if compressing the data would save bandwidth.

Is there a way to tell IO::Socket::SSL to indicate to the server that it should use compression? I gather that ZLib is built into OpenSSL by default now. Is there a way to use IO::ZLib to communicate with my SOCKET handle?

Replies are listed 'Best First'.
Re: Using ZLib with IO::Socket::SSL?
by syphilis (Archbishop) on Feb 07, 2008 at 06:29 UTC
    Is there a way to tell IO::Socket::SSL to indicate to the server that it should use compression?

    I don't know. I would think that, to begin with, both the openssl library against which IO::Socket::SSL (client) has been built, and the openssl library on the server would need to have been built with zlib support. Even then you'll probably have to rely on IO::Socket::SSL having been written with the capability of passing on the request for compression - which, one would hope, is documented (if such a capability exists).

    I gather that ZLib is built into OpenSSL by default now

    Best to check on that. When I built 0.9.8g a week or so ago, zlib support was certainly *not* the default for me - I had to explicitly declare zlib and -lz as ./config arguments.

    When building openssl-0.9.8g you'll see lots of occurrences of -DZLIB during 'make' iff it's being built with zlib support. And during 'make test' you'll see numerous lines stating Available compression methods:. Iff zlib support was included it will be specified following each of those lines.

    There are probably other ways to verify whether zlib compression was included, but I don't know what they are.

    Cheers,
    Rob
      The reason I was thinking that ZLib is in there now is references on the mailing lists like this. Im using pre-compiled .lib and .dll though so its likely not enabled there. And if (as you pointed out) the capability was in the Perl module it would be documented (which it doesn't appear to be).

      Thanks for setting me straight.