Project

General

Profile

Bug #11489

XMLRPC client cannot alter SSL options for _async calls

Added by akostadinov (Aleksandar Kostadinov) almost 5 years ago. Updated over 4 years 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.

#1

Updated by akostadinov (Aleksandar Kostadinov) almost 5 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) almost 5 years ago

  • Assignee set to openssl

Updated by tenderlovemaking (Aaron Patterson) almost 5 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

Updated by zzak (Zachary Scott) over 4 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) over 4 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) over 4 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) over 4 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 4 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 4 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 4 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.

Also available in: Atom PDF