Project

General

Profile

Bug #11489

XMLRPC client cannot alter SSL options for _async calls

Added by akostadinov (Aleksandar Kostadinov) over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
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.

Associated revisions

Revision 53318
Added by kou (Kouhei Sutou) almost 2 years ago

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

Revision 53318
Added by kou (Kouhei Sutou) almost 2 years ago

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

Revision 53935
Added by usa (Usaku NAKAMURA) almost 2 years ago

merge revision(s) 53318: [Backport #11489]

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

Revision 54069
Added by nagachika (Tomoyuki Chikanaga) almost 2 years ago

merge revision(s) 53318: [Backport #11489]

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

Revision 54359
Added by naruse (Yui NARUSE) over 1 year ago

merge revision(s) 53318: [Backport #11489]

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

History

#1 Updated by akostadinov (Aleksandar Kostadinov) over 2 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

#2 Updated by zzak (Zachary Scott) over 2 years ago

  • Assignee set to openssl

#3 [ruby-core:71249] Updated by tenderlovemaking (Aaron Patterson) about 2 years ago

zzak (Zachary Scott): 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

#4 [ruby-core:72407] Updated by zzak (Zachary Scott) almost 2 years ago

  • Assignee changed from openssl 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.

#5 Updated by kou (Kouhei Sutou) almost 2 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!!!

#6 [ruby-core:72485] Updated by kou (Kouhei Sutou) almost 2 years ago

Thanks for your report.

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

works with

xmlrpc_client.call_async(...)

on trunk.

#7 [ruby-core:73683] Updated by usa (Usaku NAKAMURA) almost 2 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

#8 [ruby-core:73982] Updated by usa (Usaku NAKAMURA) almost 2 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.

#9 [ruby-core:74244] Updated by nagachika (Tomoyuki Chikanaga) almost 2 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.

#10 [ruby-core:74653] Updated by naruse (Yui NARUSE) over 1 year 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.

Also available in: Atom PDF