Yelp/mrjob — pull request #716 by davidmarin (2013-08-30 22:30:01+00:00)
Title: Only fall back to EMR SSL host if we need to

This implements #706 (which is a better fix for #621).

The issue, in a nutshell:
* EMR endpoints are `elasticmapreduce..amazonaws.com`, but they use a certificate with the wildcard hostname `*.elasticmapreduce.amazonaws.com`, which drives SSL *crazy*.
* `boto` has a tricky workaround for this, but it only works on Python 2.7+.
* If you just go ahead and connect to `.elasticmapreduce.amazonaws.com` everything works, but it's not correct according to the AWS docs, so it's reasonable to expect it might stop working.

(For a more rambling version of this with more links and stuff, see #621.)

What I did was set things up with a wrapper class so that we'd start out by connecting to the host the documentation says, and if we get an `InvalidCertificateException`, we connect to `.elasticmapreduce.amazonaws.com` instead.

It's more code that I'd like to throw at the problem (~80 lines not counting tests), but I've convinced myself there's not really a better solution (again, see #621), and I'm pretty confident that this solution is well-tested and minimally invasive.

Plus, now we have a `RetryGoRound` class; what other library can boast that? :)