Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLSv1.0/TLSv1.1 rolling brownouts are not transparent #130

Closed
awallace-cray opened this issue Mar 22, 2018 · 44 comments
Closed

TLSv1.0/TLSv1.1 rolling brownouts are not transparent #130

awallace-cray opened this issue Mar 22, 2018 · 44 comments
Labels
pypi-tls Issues with PyPI's TLS<1.2 brownouts

Comments

@awallace-cray
Copy link

FYI, The pip clients we're using sure don't pass along any error 403 message.
The connection "succeeds" but the client just won't find anything it is looking for (pip install).
No response needed.
Thanks.

@alex alex added the pypi-tls Issues with PyPI's TLS<1.2 brownouts label Mar 22, 2018
@alex
Copy link
Member

alex commented Mar 22, 2018

What version of pip are you using?

@awallace-cray
Copy link
Author

Looks like 6.0.6.
It is baked-in.

@alex
Copy link
Member

alex commented Mar 22, 2018

Baked into what?

Can you try with the latest pip, 9.0.3?

@awallace-cray
Copy link
Author

Baked-in the project config files. Which are probably up for grabs now anyway, because the TLSv1.0/TLSv1.1 change.
Will let you know about trying pip 9.0.3.
I think root cause on our side, is using old SLES-11 machines in this project.

@dstufft
Copy link
Member

dstufft commented Mar 22, 2018

Ancient versions of OpenSSL will definitely be an issue.

@alex
Copy link
Member

alex commented Mar 22, 2018

I don't know anything about SLES, but https://www.suse.com/documentation/suse-best-practices/singlehtml/securitymodule/securitymodule.html seems like the relevant doc

@awallace-cray
Copy link
Author

Roger that. Will need new bits. Will take time. Meanwhile, a local mirror or cache or such, to keep project going. Tearing hair out today.

@ncoghlan
Copy link
Member

ncoghlan commented Mar 23, 2018

Using devpi-on-recent-Python as a caching proxy could be a pretty robust workaround for older pip clients. I'm not sure we could provide that as a generic pre-assembled solution (since the specifics will differ depending on the exact constraints preventing a pip upgrade), but I believe it would let devpi handle the TLS v1.2 link to PyPI, while talking whatever the legacy client needs on the local side of things (for a local host loopback connection, it could even be HTTP, without using TLS at all).

@awallace-cray
Copy link
Author

Our local PyPI mirror supports http and is working well. I did not build this mirror, and do not know how it works.

Pip install needs parameters --index-url $mirror_url --trusted-host $mirror_hostname,
which can be passed to pip in different ways. All good.

However, many of our scripts also use easy_install. To go get virtualenv, for example.
Easy_install works w our mirror if you add -i $mirror_url to its command line.
I wish I had an "easier" way to pass easy_install parameters, like with conf files or an env variables. Ideally, this should work even with old versions of easy_install.

@alex
Copy link
Member

alex commented Mar 23, 2018

We strongly recommend you stop using easy_install; it's been deprecated for a long time and hasn't really kept up with improvements to the packaging ecosystem.

@awallace-cray
Copy link
Author

Good advice.

Do you happen to know when the TLSv1.0/TLSv1.1 policy will be fully enforced on pypi.org?

  • Thanks

@alex
Copy link
Member

alex commented Mar 23, 2018

We'll be gradually ratcheting up the brownout periods over the next few weeks; April 8th is our current target for fully disabling them.

@awallace-cray
Copy link
Author

Said I'd get back to you on the pip error message.

time: 2018-03-23 08:06 PT
host: an old SLES-11 machine, but I am using a recently-built Python 2.7 (user-built from source)

$ pip install argparse # No 403 error message
Collecting argparse
  Could not find a version that satisfies the requirement argparse (from versions: )
No matching distribution found for argparse

$ pip install -v argparse # there it is
Collecting argparse
  1 location(s) to search for versions of argparse:
  * https://pypi.python.org/simple/argparse/
  Getting page https://pypi.python.org/simple/argparse/
  Looking up "https://pypi.python.org/simple/argparse/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pypi.python.org
  "GET /simple/argparse/ HTTP/1.1" 403 109
  Status code 403 not in [200, 203, 300, 301]
  Could not fetch URL https://pypi.python.org/simple/argparse/: 403 Client Error: Brownout of Legacy TLS for url: https://pypi.python.org/simple/argparse/ - skipping
  Could not find a version that satisfies the requirement argparse (from versions: )
Cleaning up...
No matching distribution found for argparse

$ pip --version
pip 9.0.1 from /var/tmp/chapelu/awallace/venv/lib/python2.7/site-packages (python 2.7)

$ python --version
Python 2.7.13

$ type python
python is hashed (/ptmp/chapelu/awallace/venv/bin/python)

@alex
Copy link
Member

alex commented Mar 23, 2018

@dstufft this seems like an issue, pip should, without -v, recognize a non-200 status code and print something useful. Is there an existing pip tracking bug for this?

@dstufft
Copy link
Member

dstufft commented Mar 23, 2018

It did print the status code out right?

Could not fetch URL https://pypi.python.org/simple/argparse/: 403 Client Error: Brownout of Legacy TLS for url: https://pypi.python.org/simple/argparse/ - skipping

@dstufft
Copy link
Member

dstufft commented Mar 23, 2018

I don't tihnk there's a bug for tracking any additional changes to that though, no.

@alex
Copy link
Member

alex commented Mar 23, 2018

It only printed that with -v though -- it should do more by default.

@dstufft
Copy link
Member

dstufft commented Mar 23, 2018

Oh right. Yea open an issue

@alex
Copy link
Member

alex commented Mar 23, 2018

pypa/pip#5111

@jvanasco
Copy link

FYI, pip 9.0.1 does not pass on any message or note a 403. It just says no matching versions are found, for everything. One must pass in -vvvv to see what happened.

@ntwaddell
Copy link

So what needs to be done to fix this? it's causing some of my python projects to fail in TravisCI

Could not fetch URL https://pypi.python.org/simple/pip/: 403 Client Error: Brownout of Legacy TLS

Just upgrade OpenSSL?

@jvanasco
Copy link

@ntwaddell try to upgrade pip first. you can download/run the get-pip.py from here: https://bootstrap.pypa.io/

that should fix several environments.

@alex
Copy link
Member

alex commented Mar 27, 2018

What platform are you hitting this on with Travis CI? We should make sure any builtin packages they have are updated.

@ntwaddell
Copy link

@alex I'm using TravisCI Enterprise, it always takes them longer to update their enterprise platform.

Build language: python
Build group: stable
Build dist: precise
Description: Ubuntu 12.04.5 LTS
Release: 12.04

OpenSSL is OpenSSL 1.0.1 14 Mar 2012

@alex
Copy link
Member

alex commented Mar 27, 2018

@ntwaddell On Ubuntu Precise you should be able to get a working OpenSSL by doing sudo apt-get update && sudo apt-get install --only-upgrade openssl libssl-dev.

@jvanasco
Copy link

@ntwaddell FYI, that's the first heartbleed release. That should have been upgraded years ago.

Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
Totktonada added a commit to tarantool/tarantool that referenced this issue Apr 8, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1]. It fixed by updating pip to at least 9.0.2 (tested with 9.0.3),
see [2].

[1]: pypa/packaging-problems#130
[2]: pypa/pip#4454
@gajjar8055
Copy link

I have spent around 5 hours and almost die, man

LaserPhaser added a commit to tarantool/tarantool that referenced this issue Apr 9, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
@shawngustaw
Copy link

I'm not sure if this is related at all but a coworker was having similar issues and brew install python@2 ended up fixing it. Oddly, downloading Python 2.7.14 directly from the Python website didn't work, but installing via brew and overwriting seems to be using the correct OpenSSL version.

@awallace-cray
Copy link
Author

I can confirm: brew install python@2 installs newer version of easy_install and pip in /usr/local/bin, and these clients can connect to PyPI even when the system-installed Python-2 easy_install or pip cannot.

I've read posts about brew install python fixing the same or similar problem for Python 3.

LaserPhaser added a commit to tarantool/tarantool that referenced this issue Apr 10, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
LaserPhaser added a commit to tarantool/tarantool that referenced this issue Apr 10, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
LaserPhaser added a commit to tarantool/tarantool that referenced this issue Apr 10, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
kyukhin pushed a commit to tarantool/tarantool that referenced this issue Apr 11, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
@brainwane
Copy link
Contributor

A comment on LWN suggests we should have an announcement about this on python.org. Someone could write something to post to http://blog.python.org/ which syndicates to that front page -- caution that only about the first ~30 characters will show up.

@alex
Copy link
Member

alex commented Apr 13, 2018

At this point we've had TLS 1.0/1.1 disabled 100% of the time for a few days with limited feedback, I'm reluctant to think we need further publication of this.

@damienrj
Copy link

I know this caught my company by surprise and has broken a few things.

@alex
Copy link
Member

alex commented Apr 16, 2018

Can you suggest what communications channels we could have promoted the brownouts on to help you see them?

LaserPhaser added a commit to tarantool/tarantool that referenced this issue Apr 19, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
LaserPhaser added a commit to tarantool/tarantool that referenced this issue Apr 19, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
kostja pushed a commit to tarantool/tarantool that referenced this issue May 5, 2018
The reason of the failures is TLSv1.0/TLSv1.1 brownout on the PyPI side,
see [1] for more information.

[1]: pypa/packaging-problems#130
morinted added a commit to morinted/plover that referenced this issue May 23, 2018
@brainwane
Copy link
Contributor

Now that we have entirely stopped supporting TLS 1.0 and 1.1, I am closing this issue. To be notified of future breaking changes to PyPI, please subscribe to the pypi-announce mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pypi-tls Issues with PyPI's TLS<1.2 brownouts
Projects
None yet
Development

No branches or pull requests