Project

General

Profile

fix_9858_monkey.diff

monkey patch for older versions - Marek Hulán, 03/23/2015 11:27 AM

View differences:

config/application.rb
42 42
require File.expand_path('../../lib/timed_cached_store.rb', __FILE__)
43 43
require File.expand_path('../../lib/foreman/exception', __FILE__)
44 44
require File.expand_path('../../lib/core_extensions', __FILE__)
45
require File.expand_path('../../lib/ssl_context_monkey_patch', __FILE__)
45 46

  
46 47
if SETTINGS[:support_jsonp]
47 48
  if File.exist?(File.expand_path('../../Gemfile.in', __FILE__))
lib/ssl_context_monkey_patch.rb
1
require 'openssl'
2

  
3
# we need to enforce verify_mode => 1 on SSL context
4
# more info in http://projects.theforeman.org/issues/9858
5
class OpenSSL::SSL::SSLContext
6
  alias __original_initialize initialize
7
  private :__original_initialize
8

  
9
  def initialize(*args)
10
      __original_initialize(*args)
11
      params = {
12
        :options => DEFAULT_PARAMS[:options],
13
      }
14
      set_params(params)
15
    end
16
end