Skip to content

Instantly share code, notes, and snippets.

@gep13
Last active August 29, 2015 14:06
Show Gist options
  • Save gep13/a3a0b3085495dc245297 to your computer and use it in GitHub Desktop.
Save gep13/a3a0b3085495dc245297 to your computer and use it in GitHub Desktop.
Debugging SSL issue with Ruby

What I am trying to do is debug an issue with my Ruby installation. There is a known "issue" where the CA cert file path is hardcoded to a location that doesn't exist anywhere except the build machine that the Ruby package was made on. This is detailed here:

https://groups.google.com/forum/#!topic/rubyinstaller/DVIDvs7xKC0

There are a number of "solutions" to this problem, most of which are captured here in this Stackoverflow Question:

http://stackoverflow.com/questions/11703679/opensslsslsslerror-on-heroku

I also found this gist:

https://gist.github.com/pweldon/767249

Which details the steps to go through to "fix" the problem. If I go through these steps, then the solution does actually work, for the URL that the gister provides, namely https://www.google.com/accounts, but when I try it for a URL that I am interested in, namely https://www.flickr.com/services/, the solution doesn't work.

So there is "something" going on here, I think to do with the cert file that is being downloaded, and whatever CA is being used by flickr compared to google, and I was hoping that I could use Fiddler to help figure out what that was. I might be a complete shot in the dark, and I probably won't know what I am looking for, but I will post in another file in this gist with what I have tried to proxy the request through fiddler.

Thanks!

The test that I am trying is this:

require "net/http"

proxy_addr = "127.0.0.1"
proxy_port = 8888

web_proxy = Net::HTTP::Proxy(proxy_addr, proxy_port)
url = URI.parse('http://www.rubyinside.com/test.txt')

response = web_proxy.get_response(url)
puts response.body     

Which is a basic test just to see if the proxy is being used, and then I was going to expand it to test the actual URL's that I am interested in.

However, this simply results in nothing appearing in Fiddler, but the response echo'ed to the command window:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment