OpenSSL Error when trying to hit domain with Mechanize: Hostname does not match certificated

Hi morphers,

I’ve written a little scraper to get information off the front end of policies on They Vote For You .

When Mechanize goes to get a page for the second time, it errors with:

/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/openssl/ssl.rb:232:in `post_connection_check': hostname "" does not match the server certificate (OpenSSL::SSL::SSLError)

The They Vote For You certificate has the common’.

They Vote For You always redirects to, so shouldn’t the cert not have the www? Is that a problem with the cert that needs to be corrected, or should I try and make the request without ssl? Any other more informed ideas would be very helpful :wink:


This scraper works for me if I run it locally so I’d say something is up with

I created a test scraper and it worked when hitting TVFY once but then I added a second request and it started failing so something weird is going on.

I’m with @henare here. As it works locally and only fails on looks like it’s probably an issue with’s transparent web proxy. I’ve created an issue on github for it:

I’ll take a look at this today

@henare @equivalentideas did you just get an email notifying you that I mentioned you?

@mlandauer yes, nice one!

Me too!

Thanks for picking this up gang :+1: