NET::HTTP read_nonblock rbuf_fill errors

Ruby 1.9.1, Debian Linux 7.3, Pentium 3, old hardware.
I’m trying to connect to my broker to get today’s prices.
Every example in ‘ri NET::HTTP’ works for example .com but none work for etrade.com. I suspect it’s a buffer overflow problem but have no clue how to fix it.

require ‘net/http’
$uri = URI(‘https://us.etrade.com’)
res = Net::HTTP.get($uri) # => String
puts res

Executing this gives errors:
/usr/lib/ruby/1.9.1/net/protocol.rb:141:in read_nonblock': Connection reset by peer (Errno::ECONNRESET) from /usr/lib/ruby/1.9.1/net/protocol.rb:141:in rbuf_fill’
plus a lot more in the trace.

Suggestions will be appreciated.
Thanks,
Mike

I don’t know if this is a factor, but I tried this with a newer ruby, and the URI you gave evoked a “moved permanently” message. Trying ‘https://us.etrade.com/home’ instead got a response, of 58882 characters.

2.7.1 :004 > Net::HTTP.get(URI('https://us.etrade.com'))
 => "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>301 Moved Permanently</title>\n</head><body>\n<h1>Moved Permanently</h1>\n<p>The document has moved <a href=\"https://us.etrade.com/home\">here</a>.</p>\n</body></html>\n" 
2.7.1 :005 > Net::HTTP.get(URI('https://us.etrade.com/home'))
 => "<!doctype html>\r\n<!--[if lt IE 7]>      <html lang=\"en\" class=\"no-js lt-ie9 lt-ie8 lt-ie7 ie\"> <![endif]-->\r\n<!--[if IE 7]>         <html lang=\"en\" class=\"no-js lt-ie9 lt-ie8 ie\"> <![endif]-->\r\n<!--[if IE 8]> 
# --- ETC

Unfortunately I’m stuck with the version I’ve got for the moment.
The initial URL I tried was ‘https://us.etrade.com/e/t/user/login
but since that didn’t fly I shortened it. Another I’ve tried is ‘https://invest1.ameritrade.com/grid/p/site’. These are the sites my browser uses to allow me to login to my broker sites. The browser is PaleMoon a spinoff of Mozilla/FireFox. I get the same errors trying to connect to etrade’s home with Ruby.
Further suggestions?
Thanks for trying.
Stay home, stay alive.
Mike

Having spent several days on this without getting to first base and having found several posts on stackoverflow suggesting that the version installed on my system is broken in this respect, I’ll go back to Perl where I’ve written several similar aps in the past. Ruby will just have to wait.
Thanks,
Mike

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs