Project

General

Profile

Actions

Bug #11489

closed

XMLRPC client cannot alter SSL options for _async calls

Added by akostadinov (Aleksandar Kostadinov) about 9 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[ruby-core:<unknown>]

Description

In relation to #8461
It's now easy to set SSL options like ca_path but doing an _async call creates a new connection without these options present.

I think SSL options should be configurable in the xmlrpc client itself and it pass them down to whatever HTTP connections are later created.

Actions #1

Updated by akostadinov (Aleksandar Kostadinov) about 9 years ago

e.g. if you do

xmlrpc_client.http.ca_file = @options[:ca_file]

Then xmlrpc_client.call(...) will work but not the following:

xmlrpc_client.call_async(...)

At the moment I'm using a monkey patch workaround like this:

    xmlrpc_client.http.ca_path = @options[:ca_path]
    xmlrpc_client.instance_variable_set(:@ca_path, @options[:ca_path])
    def xmlrpc_client.net_http(host, port, proxy_host, proxy_port)
      h = Net::HTTP.new host, port, proxy_host, proxy_port
      h.ca_path = @ca_path
      h
    end
Actions #2

Updated by zzak (zzak _) about 9 years ago

  • Assignee set to 7150

Updated by tenderlovemaking (Aaron Patterson) about 9 years ago

@zzak (zzak _): This seems like an issue with the XMLRPC client, not openssl?

It seems like XMLRPC should take an http object as a parameter to initialize like:

http = Net::HTTP.new *args
http.ca_path = ca_path
rpc = XMLRPC::Client.new http
...

I'm not sure what implications that would have on the internals though. For now you could work around by subclassing the client rather than monkey patching:

class MyClient < XMLRPC::Client
  def net_http(*args)
    http = super
    http.ca_path = blah
    http
  end
end

MyClient.new

Updated by zzak (zzak _) almost 9 years ago

  • Assignee changed from 7150 to kou (Kouhei Sutou)

This seems like an issue with the XMLRPC client, not openssl?

Whoops, I must have assigned by accident when I was re-assigning openssl related tickets.

I've re-assigned this ticket to Sutou san who's listed as the current maintainer. I have no idea about this ticket.

Actions #5

Updated by kou (Kouhei Sutou) almost 9 years ago

  • Status changed from Open to Closed

Applied in changeset r53318.


  • lib/xmlrpc/client.rb: Support SSL options in async methods of
    XMLRPC::Client.
    [Bug #11489]
    Reported by Aleksandar Kostadinov. Thanks!!!

Updated by kou (Kouhei Sutou) almost 9 years ago

Thanks for your report.

xmlrpc_client.http.ca_file = @options[:ca_file]

works with

xmlrpc_client.call_async(...)

on trunk.

Updated by usa (Usaku NAKAMURA) almost 9 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED

Updated by usa (Usaku NAKAMURA) over 8 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED, 2.3: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED

ruby_2_1 r53935 merged revision(s) 53318.

Updated by nagachika (Tomoyuki Chikanaga) over 8 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED, 2.3: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE, 2.3: REQUIRED

Backported into ruby_2_2 branch at r54069.

Updated by naruse (Yui NARUSE) over 8 years ago

  • Backport changed from 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE, 2.3: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE, 2.3: DONE

ruby_2_3 r54359 merged revision(s) 53318.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0