-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Cache trusted host #7885
Cache trusted host #7885
Conversation
ccbc5fb
to
7f141a2
Compare
I wonder whether something like |
Thanks for the feedback! |
Hmm, you’re right, I guess there is not a perfect name (I can think of). Let’s go with the current one and see if anyone come up with something better before this goes in. |
@NoahGorny The merge is blocked, so I cannot test it. Regards |
@hongyi-zhao Clone my forked repo, run pip locally (python src/pip) and use the flag --cache-trusted-hosts |
@NoahGorny Cannot run it at all:
What's wrong with me? |
@hongyi-zhao Checkout to my branch as well Sorry I did not mention it before |
@NoahGorny Yes, it does the trick:
But where can I find the local cached package file? I find nothing with the following command:
Wish it can be merged into master. Regards |
@hongyi-zhao I am glad this PR helped you 😄 Also, what do you guys think about this PR @pradyunsg @uranusjr? |
I think it would be OK to change the current behaviour, but I am hard-wired to reject things that could weaken security. So my preference would be +1 on this behind a flag and good documentation, and +0 on automatically enabling it by default (deferring the decision to people who disabled that cache in the first place). |
This use case is probably not important enough to have a dedicated flag-- we should either just reject the proposal or just enable it entirely and say that opting in via |
@dstufft I think the use case is pretty important given the fact that two independent issues were filed in the last week about this, just as I suffered from this. If dedicated flag is too much- than we should change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with doing this, since I guess trusting the host should only mean that pip skips TLS checks and treats the links from the host "as usual" otherwise.
I do not think we should have a flag, and this should be the default behaviour of the command.
Currently it is just the insecure adapter, but this can change in the future
news: Add news about default behaviour change
7f141a2
to
2050ecc
Compare
@pradyunsg thanks for the feedback 😃 |
@pradyunsg Any updates on this? I will have less time to work on this in the following weeks, so I want to be able to change and fix things in this PR if needed quickly |
Do you think we can merge it in time for #7951? |
Is this feature available or not now in the master branch? |
@hongyi-zhao As you can see in the bottom of this PR, this is not merged to master already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'll keep it open/un-merged for a few days, just in case @pypa/pip-committers or @pypa/pip-helpers wanna review this before it merges. :)
Thanks @NoahGorny for the PR and everyone else for their inputs here! ^>^ |
Is this feature included in pip 20.1b1? |
I did not add support for http trusted host. Maybe we should discuss this @pradyunsg (if not for this release, then for the next one) |
Got it. It is woking with https and invalid SSL certs when I'm adding the host as trusted. |
can you add suport to pip.conf too? |
I think you can create a new issue for that. Given that this is a merged PR, folks here might not get notified of your comment. |
Resolves #7847
This is impl second option discussed (in the issue), and adds a flag "cache-trusted-hosts"