Turns out & ~ does work.

Decided not to expose this as a datastore option for the Client,
but it can be used internally to toggle the compression.
bug/bundler_fix
Joe Vennix 2013-11-20 00:01:48 -06:00
parent a8c55f23a7
commit d51b92b06f
2 changed files with 6 additions and 2 deletions

View File

@ -89,7 +89,9 @@ begin
self.sslctx.ciphers = params.ssl_cipher self.sslctx.ciphers = params.ssl_cipher
end end
if not params.ssl_compression if params.ssl_compression
self.sslctx.options &= ~OpenSSL::SSL::OP_NO_COMPRESSION
else
self.sslctx.options |= OpenSSL::SSL::OP_NO_COMPRESSION self.sslctx.options |= OpenSSL::SSL::OP_NO_COMPRESSION
end end

View File

@ -139,7 +139,9 @@ module Rex::Socket::SslTcpServer
ctx.options = 0 ctx.options = 0
# enable/disable the SSL/TLS-level compression # enable/disable the SSL/TLS-level compression
if not params.ssl_compression if params.ssl_compression
ctx.options &= ~OpenSSL::SSL::OP_NO_COMPRESSION
else
ctx.options |= OpenSSL::SSL::OP_NO_COMPRESSION ctx.options |= OpenSSL::SSL::OP_NO_COMPRESSION
end end