Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:error': 0.03; 'anyway.': 0.05; 'dynamically': 0.07; 'pypi': 0.07; 'library?': 0.09; 'resp': 0.09; 'security.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '**kwargs)': 0.16; '49,': 0.16; '60,': 0.16; 'libraries.': 0.16; 'rebuild': 0.16; 'url:ftp': 0.16; 'usage,': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'seems': 0.21; '>>>': 0.22; 'example': 0.22; 'import': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'install': 0.23; '>>>': 0.24; 'ssl': 0.24; 'paul': 0.24; 'versions': 0.24; 'file.': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; '>': 0.26; 'extension': 0.26; 'downloaded': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'raise': 0.29; 'thus': 0.29; "doesn't": 0.30; 'newer': 0.30; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'requests': 0.31; '"",': 0.31; 'reduced': 0.31; 'sep': 0.31; 'skip:& 70': 0.31; 'workaround': 0.31; 'file': 0.32; 'python.org': 0.32; 'option': 0.32; 'another': 0.32; 'url:python': 0.33; 'running': 0.33; '(most': 0.33; 'guess': 0.33; 'mac': 0.33; 'updated': 0.34; 'subject:the': 0.34; 'subject:with': 0.35; 'skip:s 30': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'url:listinfo': 0.36; 'next': 0.36; 'url:org': 0.36; 'skip:- 20': 0.37; 'expected': 0.38; 'skip:& 10': 0.38; 'problems': 0.38; 'e.g.': 0.38; 'nov': 0.38; 'handle': 0.38; 'issue': 0.38; 'recent': 0.39; 'skip:& 20': 0.39; 'does': 0.39; 'unable': 0.39; 'release': 0.40; 'url:mail': 0.40; 'skip:u 10': 0.60; 'manually': 0.60; 'tell': 0.60; 'url:5': 0.61; 'new': 0.61; 'browser': 0.61; 'skip:* 10': 0.61; 'skip:6 10': 0.63; 'skip:n 10': 0.64; 'more': 0.64; 'different': 0.65; 'linked': 0.65; 'latest': 0.67; 'article': 0.77; '2014,': 0.84; '4.2.1': 0.84; 'bypasses': 0.84; 'installer': 0.84; 'itself?': 0.84; 'python-': 0.84; 'source?': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=y5t7BrgirkzytNiNNVXi19eaGUkndEqFzX7Nk9GFsFI=; b=NEWFZ63bCnH7BZKr3Qyq7afhCT5rZD+VMx9+88Rp5Jj6wp28f9twSGc4YvjOXpGX/E Yb0Vyelepu2BZgLSioNExsInIyp5IKYhjsIp/gXwSMXu/zGKHuNA9K7CxjutGT7qKLol wMk1xE/hIWktzAKYNdazZwW6Q2ygbZgJQVHyIZJUvVFJ7ji+kCmcqcCjNqCfljF46vn5 KfaGmjAUhpVrXr8NceqEDRAY/6AXZLjWcNn+HKe9qDHWkLoYFyDXHEBIorJmqfOt/YNf lfz6T9MPGdDMwPx5807ZUjYCQGMFd2JNF6vUGy1TGflQzTio9OWAZjQDEyfwWCTC1fQw h8yg== MIME-Version: 1.0 X-Received: by 10.194.52.36 with SMTP id q4mr48555232wjo.114.1417433397687; Mon, 01 Dec 2014 03:29:57 -0800 (PST) In-Reply-To: References: Date: Mon, 1 Dec 2014 11:29:57 +0000 Subject: Re: ssl error with the python mac binary From: Paul Wiseman To: Ned Deily Content-Type: multipart/alternative; boundary=047d7bacb0f6297c05050925eed7 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 192 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417433399 news.xs4all.nl 2960 [2001:888:2000:d::a6]:54449 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81747 --047d7bacb0f6297c05050925eed7 Content-Type: text/plain; charset=UTF-8 On 10 November 2014 at 22:51, Ned Deily wrote: > In article > , > Paul Wiseman wrote: > > I've been using the latest mac ppc/i386 binaries from python.org > > (https://www.python.org/ftp/python/2.7.8/python-2.7.8-macosx10.5.dmg). > > From what I can tell this version is linked against a pretty old > > version of OpenSSL (OpenSSL 0.9.7l 28 Sep 2006) which doesn't seem to > > be able to handle new sha-256 certificates. > > > > For example I'm unable to use pip (I guess the certificate was updated > > recently) > > Yes, the current python.org certificate does seem to cause problems for > that version of OpenSSL, unfortunately. > > > Am I right in thinking this is an issue with the build of python > > itself? Is there a way I can upgrade the version of OpenSSL linked > > with python- or force the python build to look elsewhere for the > > library? Or will I have to build my own from source? > > In the Pythons from the python.org OS X installers, the Python _ssl and > _hashlib extension modules are dynamically linked with the > system-supplied OpenSSL libraries. If actually running on OS X 10.5, > one would have to rebuild _ssl.so and _hashlib.so, linking them with a > locally-supplied version of a newer OpenSSL, since different versions of > OpenSSL are not ABI-compatible, e.g. 0.9.7 vs 0.9.8 vs 1.0.1. If > running on OS X 10.6 or later, another option might be to install from > the 64-bit/32-bit installer which is a good idea to do anyway. For pip > usage, a workaround would be to manually download distributions from > PyPI (or elsewhere) using a web browser and then use pip to install from > the downloaded file. The next version of pip is expected to have a > --no-check-certificate option that bypasses the certificate check at the > cost of reduced security. For the upcoming Python 2.7.9 release > (planned for early December), I intend to have the Pythons in the > python.org OS X installers use their own versions of OpenSSL and thus no > longer depend on the now-deprecated system OpenSSL. > > I just gave 2.7.9rc1 a go and seems like it is still linked to the same version of openssl? Python 2.7.9rc1 (v2.7.9rc1:40eada278702, Nov 25 2014, 17:10:11) [GCC 4.2.1 (Apple Inc. build 5577)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> >>> import requests >>> requests.get("https://python.org") Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/api.py", line 60, in get return request('get', url, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/api.py", line 49, in request return session.request(method=method, url=url, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/sessions.py", line 457, in request resp = self.send(prep, **send_kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/sessions.py", line 569, in send r = adapter.send(request, **kwargs) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg/requests/adapters.py", line 420, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581) >>> >>> import ssl >>> ssl.OPENSSL_VERSION 'OpenSSL 0.9.7l 28 Sep 2006' > -- > Ned Deily, > nad@acm.org > > -- > https://mail.python.org/mailman/listinfo/python-list > --047d7bacb0f6297c05050925eed7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On 10 November 2014 at 22:51, Ned Deily <nad@acm.org> wrote:=
In article
<CACgdh2iG9+cLjj7mZ7qeALQd=3D=3DpCRknnv8i_EeRj6AHjvg3cRQ@mail.gmail.com>,
=C2=A0Paul Wiseman <poalman@gmail.com> wrote:
> I've been using the latest mac ppc/i386 binaries from python.org
> (https://www.python.org/ftp/python/2.7.8/python= -2.7.8-macosx10.5.dmg).
> From what I can tell this version is linked against a pretty old
> version of OpenSSL (OpenSSL 0.9.7l 28 Sep 2006) which doesn't seem= to
> be able to handle new sha-256 certificates.
>
> For example I'm unable to use pip (I guess the certificate was upd= ated
> recently)

Yes, the current pyt= hon.org certificate does seem to cause problems for
that version of OpenSSL, unfortunately.

> Am I right in thinking this is an issue with the build of python
> itself? Is there a way I can upgrade the version of OpenSSL linked
> with python- or force the python build to look elsewhere for the
> library? Or will I have to build my own from source?

In the Pythons from the python.org OS X installers, the Python _ssl and
_hashlib extension modules are dynamically linked with the
system-supplied OpenSSL libraries.=C2=A0 If actually running on OS X 10.5,<= br> one would have to rebuild _ssl.so and _hashlib.so, linking them with a
locally-supplied version of a newer OpenSSL, since different versions of OpenSSL are not ABI-compatible, e.g. 0.9.7 vs 0.9.8 vs 1.0.1.=C2=A0 If
running on OS X 10.6 or later, another option might be to install from
the 64-bit/32-bit installer which is a good idea to do anyway.=C2=A0 For pi= p
usage, a workaround would be to manually download distributions from
PyPI (or elsewhere) using a web browser and then use pip to install from the downloaded file.=C2=A0 =C2=A0The next version of pip is expected to hav= e a
--no-check-certificate option that bypasses the certificate check at the cost of reduced security.=C2=A0 For the upcoming Python 2.7.9 release
(planned for early December), I intend to have the Pythons in the
python.org OS X install= ers use their own versions of OpenSSL and thus no
longer depend on the now-deprecated system OpenSSL.


I just gave 2.7.9rc1 a go and seems like it is still linke= d to the same version of openssl?
=C2=A0
Python 2.7.9rc1 (v2.7.9rc1:40eada278702, Nov 25 2014, 17:10:11)
[G= CC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "= ;copyright", "credits" or "license" for more infor= mation.
>>>
>>> import requests
>>> req= uests.get("https://python.org"= )
Traceback (most recent call last):
=C2=A0 File "<stdin>&= quot;, line 1, in <module>
=C2=A0 File "/Library/Frameworks/P= ython.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2= .7.egg/requests/api.py", line 60, in get
=C2=A0 =C2=A0 return reque= st('get', url, **kwargs)
=C2=A0 File "/Library/Frameworks/P= ython.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.4.3-py2= .7.egg/requests/api.py", line 49, in request
=C2=A0 =C2=A0 return s= ession.request(method=3Dmethod, url=3Durl, **kwargs)
=C2=A0 File "/= Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-package= s/requests-2.4.3-py2.7.egg/requests/sessions.py", line 457, in request=
=C2=A0 =C2=A0 resp =3D self.send(prep, **send_kwargs)
=C2=A0 File &q= uot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa= ckages/requests-2.4.3-py2.7.egg/requests/sessions.py", line 569, in se= nd
=C2=A0 =C2=A0 r =3D adapter.send(request, **kwargs)
=C2=A0 File &q= uot;/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa= ckages/requests-2.4.3-py2.7.egg/requests/adapters.py", line 420, in se= nd
=C2=A0 =C2=A0 raise SSLError(e, request=3Drequest)
requests.except= ions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (= _ssl.c:581)
>>>
>>> import ssl
>>> ssl.= OPENSSL_VERSION
'OpenSSL 0.9.7l 28 Sep 2006'

--047d7bacb0f6297c05050925eed7--