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

sage-download-file: Proper initialization of SSL certificates #30950

Closed
mkoeppe opened this issue Nov 23, 2020 · 18 comments
Closed

sage-download-file: Proper initialization of SSL certificates #30950

mkoeppe opened this issue Nov 23, 2020 · 18 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 23, 2020

(from #29418)

See ticket description of #29418 and the change made in #32527.

When done, we can switch sage-bootstrap-python back to preferring python3 on macOS.

CC: @jhpalmieri @dimpase @Etn40ff @sagetrac-tmonteil

Component: build

Author: Thierry Monteil

Branch/Commit: u/tmonteil/sage_download_file__proper_initialization_of_ssl_certificates @ f0ded55

Issue created by migration from https://trac.sagemath.org/ticket/30950

@mkoeppe mkoeppe added this to the sage-9.3 milestone Nov 23, 2020
@jhpalmieri
Copy link
Member

comment:1

Is this necessary? I'm not sure how to test, but here's what I did: with #29719 (new flint), I used

$ ./configure --with-python=/usr/bin/python3 --enable-download-from-upstream-url --with-system-flint=no
$ make flint

flint was downloaded properly. Since that worked, I tried a pip package:

$ ./sage -i biopython

That also worked. What should I be testing?

Edit: hold on, trying again after editing build/bin/sage-system-python.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 23, 2020

comment:2

This is affecting upstream URLs that are https.
You can test by replacing upstream/mirror_list by something that always fails to force download from the upstream URL.

@jhpalmieri
Copy link
Member

comment:3

I put a print statement in sage-system-python to say what Python it's using (2nd line below). I removed the attrs tarball and modified mirror_list to only include https sites. I see this at the top of the attrs log file:

[attrs-19.3.0] Found local metadata for attrs-19.3.0
[attrs-19.3.0] PYTHON=/usr/bin/python3
[attrs-19.3.0] Attempting to download package attrs-19.3.0.tar.gz from mirrors
[attrs-19.3.0] https://mirror.csclub.uwaterloo.ca/sage/spkg/upstream/attrs/attrs-19.3.0.tar.gz
[attrs-19.3.0] [......................................................................]
[attrs-19.3.0] attrs-19.3.0

@jhpalmieri
Copy link
Member

comment:4

I then modified sage_bootstrap/download/mirror_list.py:

diff --git a/build/sage_bootstrap/download/mirror_list.py b/build/sage_bootstrap/download/mirror_list.py
index 12868bf608..3a4b9d22fc 100644
--- a/build/sage_bootstrap/download/mirror_list.py
+++ b/build/sage_bootstrap/download/mirror_list.py
@@ -200,8 +200,6 @@ class MirrorList(object):
             pass
         for mirror in self.mirrors:
             yield mirror
-        # If all else fails: Try the packages we host ourselves
-        yield 'http://sagepad.org/'
 
     @property
     def fastest(self):

and changed mirror_list to include just a nonsense site. Then

Found local metadata for attrs-19.3.0
PYTHON=/usr/bin/python3
Attempting to download package attrs-19.3.0.tar.gz from mirrors
http://uw.edu/spkg/upstream/attrs/attrs-19.3.0.tar.gz
[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
ERROR [transfer|run:135]: [Errno socket error] [Errno socket error] [Errno 404] Not Found: '//www.washington.edu/spkg/upstream/attrs/attrs-19.3.0.tar.gz'
Attempting to download from https://pypi.io/packages/source/a/attrs/attrs-19.3.0.tar.gz
[......................................................................]
attrs-19.3.0
====================================================

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 23, 2020

comment:5

This looks promising... I'm surprised that this seems to be working now. I don't think we changed anything. You don't have SAGE_DOWNLOAD_FILE_OPTIONS set in your global environment by any chance?

@jhpalmieri
Copy link
Member

comment:6

I may be too optimistic, and it may depend, for example, on the version of OS X. Does the version of Python 3 depend on the version of Xcode, or the OS version, or something else? Anyway, this testing was done on Big Sur, although the same version of Python (3.8.2) is present on 10.15.7. The previous problems were reported with Python 3.7, I think.

I don't set any environment variables with names starting "SAGE".

@dimpase
Copy link
Member

dimpase commented Nov 23, 2020

comment:7

what is the Python3 involved here?

@dimpase
Copy link
Member

dimpase commented Nov 23, 2020

comment:8

You can have Python3 installed in Homebrew, Python3 installed from python.org, and system-provided Python3.

@jhpalmieri
Copy link
Member

comment:9

In my testing, it's the system-provided Python 3, /usr/bin/python3.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 24, 2021

comment:11

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 9, 2021
@mkoeppe

This comment has been minimized.

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Sep 29, 2021

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Sep 29, 2021

Commit: f0ded55

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Sep 29, 2021

comment:16

Could you please tell if the proposed branch fixes your issue on MacOS ?


New commits:

f0ded55#30950 : add a default SSL context for sage_bootstrap/download

@sagetrac-tmonteil
Copy link
Mannequin

sagetrac-tmonteil mannequin commented Sep 29, 2021

Author: Thierry Monteil

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 30, 2021

comment:17

Hm... I am having difficulty reproducing the original problem on my current system... this might confirm comment:1, comment:6

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 18, 2021

comment:18

Stalled in needs_review or needs_info; likely won't make it into Sage 9.5.

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Apr 11, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 10, 2023

Haven't seen any problems with SSL in a while. Let's close it.

@mkoeppe mkoeppe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants