-
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
Which is the recommended value of trusted host when the URL contains port #6705
Comments
Can you show the output of the other two of the four cases?
|
They both succeeded so i didn' show in my desc.
|
Maybe one approach for this can be--
|
@cjerdonek I am curious about the reason why w/o port is preferred over the other. From a rough digging into the code, I found that an insecure host is bypassed using the requests' pip/src/pip/_internal/download.py Lines 598 to 600 in 34621bf
At that point, we don't know the exact port of the host, if no port is provided through Therefore, it is more straightforward to always use host with port. But I am also OK with the decisions made by maintainers if you insist. I am glad to send a PR then. |
I wasn't expressing a preference but rather just making a suggestion to start talking about possible solutions. There are a couple factors that seem important: (1) Is the port looked at when using
|
@cjerdonek Makes sense now. |
Environment
Description
When the index URL contains port, the behavior of trusted is inconsistent depending on it's HTTP or HTTPS.
For HTTP indexes, Pip complains that trusted host should be sans-port. However, using port doesn't work for HTTPS indexes, throwing an SSL error.
Expected behavior
There should only one way to specify trusted host.
How to Reproduce
See the following steps. Note for the index URLs and trusted host values.
Output
HTTP
HTTPS
The text was updated successfully, but these errors were encountered: