Trusted Hosts Aren't Cached
See original GitHub issueEnvironment
- pip version: 20.0.2
- Python version: 3.7.3
- OS: CentOS Linux release 7.4.1708
- Virtualenv version: 16.6.1 (ran as “virtualenv --python=3.7 build/python_env”)
Description If a host is added as a trusted-host, it won’t use the cache.
Expected behavior trusted-hosts use the cache.
How to Reproduce
- pip config --site set global.index-url https://example.com/api/pypi/pypi/simple/
- pip config --site set global.trusted-host example.com
- pip install -r pip_requirements.txt
Output Line from broken output:
Collecting requests==2.23.0
Downloading https://artifactory.rnclab.us.alcatel-lucent.com/artifactory/api/pypi/pypi/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 3.0 MB/s
Line from non-broken output (not configuring trusted-host):
Collecting requests==2.23.0
Using cached https://example.com/artifactory/api/pypi/pypi/packages/1a/70/1935c770cb3be6e3a8b78ced23d7e0f3b187f5cbfab4749523ed65d7c9b1/requests-2.23.0-py2.py3-none-any.whl (58 kB)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Trusted Host settings | Installing Drupal
Drupal core's page cache uses the domain as part of the cache ID, preventing this problem, but other caching mechanisms may not be...
Read more >Configure the Trusted Key Provider for Trusted Hosts Using ...
You can configure trusted key providers by using the command line. ... get the key provider, and for the vCenter Server to update...
Read more >How can I rebuild the "Trusted Hosts" list in Greylisting
Hello guys. I have this server where after activating Greylisting, it has no entries in the Trusted Hosts list. Only the current host...
Read more >How to Configure Trusted Hosts - Barracuda Campus
Trusted Host Name – Enter a trusted host name to which you want to exempt the security checks. Host names cannot include space...
Read more >Trust caches - Apple Support
This trust cache permits a chunk of code within the software update—the update brain—to run with platform privilege. The update brain performs ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The change discussed for not caching packages from insecure origins was introduced alongside the
--trusted-host
flag in pip version 6. Then, installing from insecure origins was deprecated but not disabled (pip reported a warning, but still fetched the packages). As a result, the cache could still be poisoned by untrusted origins.Since version 7, pip does not allow fetching packages from insecure origins unless they are explicitly marked trusted. As a result, the original change for not caching packages loses merit, because the cache cannot be poisoned anymore by untrusted origins (pip refuses to fetch the packages).
In light of the above, I believe the correct solution here is option 1.
hey @pradyunsg. can you please take a look at this and the PR I opened to solve it? 😄