XML-RPC over SSL with Ruby: end of file reached (EOFError)

Posted by Michael Conigliaro on Stack Overflow See other posts from Stack Overflow or by Michael Conigliaro
Published on 2010-05-04T16:00:08Z Indexed on 2010/05/05 16:48 UTC
Read the original article Hit count: 277

Filed under:
|
|
|

Hello,

I have some very simple Ruby code that is attempting to do XML-RPC over SSL:


require 'xmlrpc/client'
require 'pp'

server = XMLRPC::Client.new2("https://%s:%d/" % [ 'api.ultradns.net', 8755 ])
pp server.call2('UDNS_OpenConnection', 'sponsor', 'username', 'password')

The problem is that it always results in the following EOFError exception:


/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:135:in `sysread': end of file reached (EOFError)

So it appears that after doing the POST, I don't get anything back. Interestingly, this is the behavior I would expect if I tried to make an HTTP connection on the HTTPS port (or visa versa), and I actually do get the same exact exception if I change the protocol. Everything I've looked at indicates that using "https://" in the URL is enough to enable SSL, but I'm starting wonder if I've missed something.

Note that Even though the credentials I'm using in the RPC are made up, I'm expecting to at least get back an XML error page (similar to if you access https://api.ultradns.net:8755/ with a web browser). I've tried running this code on OSX and Linux with the exact same result, so I have to conclude that I'm just doing something wrong here. Does anyone have any examples of doing XML-RPC over SSL with Ruby?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about xml-rpc