sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
654 stars 412 forks source link

Should be able to specify ca-path #140

Open akostadinov opened 8 years ago

akostadinov commented 8 years ago

Hello, to connect a private JIRA instance with not recognized certificate, one usually selects ca_path option somehow. But I don't see any way to do that with current API.

pruan-rht commented 8 years ago

@sumoheavy, here's an example of the monkey patch we are using to get around the issue...hope it helps to clarify our use case.

module JIRA
  class HttpClient
    old_http_client = instance_method(:http_conn)
    define_method(:http_conn) do |url|
      h = old_http_client.bind(self).(url)
      h.ca_path = @options[:ca_path] if @options[:ca_path]
      h.ca_file = @options[:ca_file] if @options[:ca_file]
      return h
    end
  end
end
grekko commented 8 years ago

I would also be interested in a proper solution. Until then I'll go w/ the monkey patch of @pruan-rht. Thanks for that! :)