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

Finalize TLS1.0/1.1 removal on PyPI #3411

Closed
8 tasks done
alex opened this issue Mar 25, 2018 · 27 comments
Closed
8 tasks done

Finalize TLS1.0/1.1 removal on PyPI #3411

alex opened this issue Mar 25, 2018 · 27 comments

Comments

@alex
Copy link
Member

alex commented Mar 25, 2018

We've been conducting a series of brownouts to make sure people are aware of the need to make sure their clients are up to date. This issue is to track the current schedule of updates to the brownout window (which may change as time goes on):

  • March 22nd, brownouts begin :00-:10 every hour
  • March 25th, :00-:15 every hour
  • March 28th, :00-:15, :30-:35 every hour
  • March 31st, :00-:15, :30-:40 every hour
  • April 3rd, :00-:15, :30-:45 every hour
  • April 6th, :00-:20, :30-:50 every hour
  • April 8th, TLS 1.0/1.1 disabled
  • April 10th, TLS1.0/1.1 disabled at fastly handshake
@dstufft
Copy link
Member

dstufft commented Mar 25, 2018

Just bumped the brownout to the first 15 minutes.

@jvanasco
Copy link

FYI, I got locked out for well over an hour with a pip 9.0.1 client (no proxy, traffic from NYC).

Would it be possible to provide a (temporary) whitelisted migration package to assist in upgrades, like offering pip by a name like 'pip-brownout' during this time?

It's a bit of a pain distributing and installing a downloaded .tgz of pip onto Test and CI servers (multiple virtualenvs and the system version need to be installed).

Also as a suggestion: it would make sense to scatter the brownout window as some automated systems might not try to call pip/etc until the 2nd half of the hour.

@alex
Copy link
Member Author

alex commented Mar 25, 2018

@jvanasco for issues with the brownout, please file bugs on https://github.com/pypa/packaging-problems/issues. This bug is just for tracking the ops side of it.

@jvanasco
Copy link

@alex will do. you may want to change the message on https://status.python.org/incidents/629scscfypvt , which is hotlinked from pipi, that redirects here.

@dstufft
Copy link
Member

dstufft commented Mar 26, 2018 via email

@brainwane
Copy link
Contributor

Sometime between now and April 8th, could we have a few days where the brownout starts at the half-hour or includes the half-hour? I'm thinking about India, where (I presume) some substantial chunk of our traffic originates, and where timezones are a half-hour off from most other timezones.

@alex
Copy link
Member Author

alex commented Mar 27, 2018

The next milestone will be 20 minutes outage per hour, maybe we should do :00-:10 and :30-:40?

@dstufft
Copy link
Member

dstufft commented Mar 27, 2018

We can do that, it's pretty easy.

@pradyunsg
Copy link
Contributor

Maybe OP can be updated -- to mention the :00-:10 and :30-:40 plan?

@alex
Copy link
Member Author

alex commented Mar 28, 2018

I've updated. @dstufft of note, I switched from :00-:10 + :30-:40 to :00-:15 + :30-:35, which is the same number of minutes of brownout, but avoids any "regressions" in coverage.

@brainwane
Copy link
Contributor

@alex just to be clear, since you added this to the launch/redirect milestone -- you believe that completing this is a blocker to the redirect? (So, even if we finish all the other Warehouse features/infra in that milestone before April 8th, we should wait for this?) I'm fine with it if that's your assessment, but I just want to check.

@alex
Copy link
Member Author

alex commented Mar 28, 2018 via email

@dstufft
Copy link
Member

dstufft commented Mar 28, 2018

Brownout updated for :00-:15, :30-:35 every hour

@dstufft
Copy link
Member

dstufft commented Mar 31, 2018

Brownout updated to :00-:15, :30-:40 every hour.

@dstufft
Copy link
Member

dstufft commented Apr 3, 2018

Brownout updated to :00-:15, :30-:45 every hour.

@di di moved this from Milestone 4: Redirect/Launch to In Progress in Warehouse rollout Apr 4, 2018
@ben-albrecht
Copy link

From the PyPI status page:

For users of pip on MacOS/OS X, upgrading to the latest pip should resolve the issue. pip users on other platforms should upgrade their OpenSSL to a version which supports TLSv1.2.

Out of curiosity, what about MacOS/OS X is unique such that users only need to update pip?

@alex
Copy link
Member Author

alex commented Apr 5, 2018

@ben-albrecht macOS users are impacted because the system Python linked against an ancient copy of OpenSSL that macOS shipped until 10.13. We workaround this in really recent versions of pip by using SecureTransport, which is the official Apple TLS library, and it supported TLS1.2 a long time ago.

@ben-albrecht
Copy link

@alex - Thanks for the info!

I have observed that easy_install is also vulnerable to this brownout on OS X. I assume this is because easy_install uses the system OpenSSL on OS X instead of SecureTransport like pip does - is that right?

@alex
Copy link
Member Author

alex commented Apr 5, 2018 via email

@dstufft
Copy link
Member

dstufft commented Apr 6, 2018

Brownout updated to April 6th, :00-:20, :30-:50 every hour.

2 more days left till this is complete!

@dstufft
Copy link
Member

dstufft commented Apr 8, 2018

Brownout has been updated to a blackout, all TLSv1.0 and TLSv1.1 access to PyPI now results in a HTTP 403 error:

$ curl -i https://pypi.python.org/simple/ --tlsv1.0 --http1.1
HTTP/1.1 403 TLSv1.2+ is required
Server: Varnish
Retry-After: 0
Content-Type: text/plain; charset=UTF-8
Content-Length: 170
Accept-Ranges: bytes
Date: Sun, 08 Apr 2018 16:07:40 GMT
Via: 1.1 varnish
Connection: close
X-Served-By: cache-ewr18134-EWR
X-Cache: MISS
X-Cache-Hits: 0
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Permitted-Cross-Domain-Policies: none

Support for TLSv1.0 has been removed, please upgrade to a TLSv1.2+ client. Please see https://pyfound.blogspot.com/2017/01/time-to-upgrade-your-python-tls-v12.html

In 2 more days, we will disable TLSv1.0 and TLSv1.1 completely at the TLS handshake level.

@ncoghlan
Copy link
Contributor

ncoghlan commented Apr 9, 2018

Is there a good end-user reference on exactly what they need to cope with the TLS v1.0/v1.1 support? https://pyfound.blogspot.com.au/2017/01/time-to-upgrade-your-python-tls-v12.html is the best I found, and that's a little dated now.

Context is pypa/packaging-problems#137, where I'm not sure what's going on with Mac OS X, and neither the PSF blog post, nor the Python 2.7 documentation are clear on exactly which python.org installers will work, and which Mac OS X system Python versions will work.

@dstufft
Copy link
Member

dstufft commented Apr 9, 2018

I think all of the Python.org installers for 2.7 are currently affected. Actually uploading didn't occur to me at all, it would be reasonable to raise an issue with Twine to see if we can get a quick release out that enables SecureTransport on macOS.

We don't have a great end user guide, but effectively they need a Python that links against a new enough version of OpenSSL (python -c "import ssl; print(ssl.OPENSSL_VERSION)" needs to say 1.0.1 or higher, unless their distro has patched OpenSSL to add/remove TLSv1.2 support without updating version). The other way around it is to use a library other than OpenSSL to handle TLS, for requests/urllib3 on macOS this is as simple as:

import sys, ssl

# Checks for OpenSSL 1.0.1 on MacOS
if sys.platform == "darwin" and ssl.OPENSSL_VERSION_NUMBER < 0x1000100f:
    try:
        import urllib3.contrib.securetransport
    except (ImportError, OSError):
        pass
    else:
        urllib3.contrib.securetransport.inject_into_urllib3()

The above snippet of code only uses SecureTransport in cases where it's needed.

@dstufft
Copy link
Member

dstufft commented Apr 9, 2018

Ned Deily went into some pretty fantastic detail (although it was pip specific, but pip specific really just means it has the above snippet or not) in #3293 (comment).

@ncoghlan
Copy link
Contributor

ncoghlan commented Apr 9, 2018

Ah, I thought I'd seen something from @brainwane about this: https://mail.python.org/pipermail/python-announce-list/2018-April/011885.html

For whatever reason, Google still isn't indexing mail.python.org very well, so even highly relevant posts often don't show up in search results :(

@dstufft
Copy link
Member

dstufft commented Apr 10, 2018

Email sent to Fastly to get TLSv1.0 and TLSv1.1 disabled, will update and close when they've done that.

@dstufft
Copy link
Member

dstufft commented Apr 10, 2018

This is done now.

$ curl -i https://pypi.python.org/simple/ --tlsv1.0 --http1.1
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

$ curl -i https://pypi.org/simple/ --tlsv1.0 --http1.1
curl: (35) error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

@dstufft dstufft closed this as completed Apr 10, 2018
Warehouse rollout automation moved this from In Progress to Done Apr 10, 2018
brainwane added a commit that referenced this issue Apr 16, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
brainwane added a commit that referenced this issue Apr 16, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
brainwane added a commit that referenced this issue Apr 17, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
brainwane added a commit that referenced this issue Apr 17, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
brainwane added a commit that referenced this issue Apr 17, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
brainwane added a commit that referenced this issue Apr 17, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
brainwane added a commit that referenced this issue Apr 17, 2018
Add context and instructions for users affected by the
TLS 1.0/1.1 deprecation.

Followup to #3411, #3293.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

7 participants