Python 2.7 urllib2 returns SSLv3 handshake failure
<p>I have Python 2.7.9 on Mac OS 10.10. When I tried using urllib2, it gives the SSLv3 handshake failure. Here is the following code that I had tried:</p>

<pre><code>URLaccess_token = "https://&lt;some_pony_website&gt;.net/oauth/access_token"
values = dict(grant_type="authorization_code", code=code, redirect_uri="http://127.0.0.1:5000", client_id="&lt;secret_id&gt;", client_secret="&lt;seriously_this_is_a_secret&gt;")
data = urllib.urlencode(values)
req = urllib2.Request(URLaccess_token, data)
rsp = urllib2.urlopen(req)
content = rsp.read()
return content
</code></pre>

<p>This produces the following error:</p>

<pre><code>URLError: &lt;urlopen error [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3  
alert handshake failure (_ssl.c:581)&gt;
</code></pre>

<p>What is the solution to this problem?</p>