From 3ccd77f479a3cab50f11fcf8990db09fa53cf017 Mon Sep 17 00:00:00 2001 From: jlhonora <jlhonora@ing.puc.cl> Date: Fri, 6 May 2016 10:19:43 -0300 Subject: [PATCH] Only add NO_COMPRESSION flag if defined --- lib/geocoder/lookups/google.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/geocoder/lookups/google.rb b/lib/geocoder/lookups/google.rb index 8483f137..4c815706 100644 --- a/lib/geocoder/lookups/google.rb +++ b/lib/geocoder/lookups/google.rb @@ -30,7 +30,11 @@ module Geocoder::Lookup def configure_ssl!(client) client.instance_eval { @ssl_context = OpenSSL::SSL::SSLContext.new - @ssl_context.set_params({:options=> OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3 | OpenSSL::SSL::OP_NO_COMPRESSION}) + options = OpenSSL::SSL::OP_NO_SSLv2 | OpenSSL::SSL::OP_NO_SSLv3 + if OpenSSL::SSL.const_defined?('OP_NO_COMPRESSION') + options |= OpenSSL::SSL::OP_NO_COMPRESSION + end + @ssl_context.set_params({options: options}) } end -- GitLab