Project

General

Profile

Actions

Bug #11489

closed

XMLRPC client cannot alter SSL options for _async calls

Bug #11489: XMLRPC client cannot alter SSL options for _async calls

Added by akostadinov (Aleksandar Kostadinov) about 10 years ago. Updated over 9 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.

Updated by akostadinov (Aleksandar Kostadinov) about 10 years ago Actions #1

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

Updated by zzak (zzak _) about 10 years ago Actions #2

  • Assignee set to 7150

Updated by tenderlovemaking (Aaron Patterson) almost 10 years ago Actions #3 [ruby-core:71249]

@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 10 years ago Actions #4 [ruby-core:72407]

  • 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.

Updated by kou (Kouhei Sutou) almost 10 years ago Actions #5

  • 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 10 years ago Actions #6 [ruby-core:72485]

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) over 9 years ago Actions #7 [ruby-core:73683]

  • 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 9 years ago Actions #8 [ruby-core:73982]

  • 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 9 years ago Actions #9 [ruby-core:74244]

  • 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 9 years ago Actions #10 [ruby-core:74653]

  • 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: PDF Atom