-
Couldn't load subscription status.
- Fork 3
CLI-14/ssl-config #146
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
Open
zfralish
wants to merge
25
commits into
main
Choose a base branch
from
CLI-14/ssl-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CLI-14/ssl-config #146
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c76613e
Not entirely sure what im doing.
zfralish c9dcfb0
chore(pre-commit): linting
0122e39
conda import needs to be in try except
zfralish 3877078
Merge branch 'CLI-14/ssl-config' of https://github.com/anaconda/anaco…
zfralish 0c5fad9
chore(pre-commit): linting
c08c7b9
fixing a mypy issue
zfralish 746736c
Merge branch 'CLI-14/ssl-config' of https://github.com/anaconda/anaco…
zfralish 27f4f55
removing uneeded var
zfralish a50f64a
does adding this dep work?
zfralish f5da00c
tsk tsk shouldnt do this
zfralish 14f10ed
cleaning up a bit
zfralish a703eba
fixing types
zfralish 7d37ba1
Merge branch 'main' into CLI-14/ssl-config
zfralish a093107
Merge branch 'main' into CLI-14/ssl-config
zfralish 209ae9e
oopsie
zfralish 904ab50
standardizing the ssl_verify type
zfralish 86264e0
chore(pre-commit): linting
bd0faeb
specifying exception
zfralish 1a54c99
Merge branch 'CLI-14/ssl-config' of https://github.com/anaconda/anaco…
zfralish dea838a
fixing optional
zfralish df5294a
splitting up retrieving and settin
zfralish 2c4b199
chore(pre-commit): linting
f5a079c
fixing tox mypy
zfralish d571eac
Merge branch 'CLI-14/ssl-config' of https://github.com/anaconda/anaco…
zfralish 40f9635
chore(pre-commit): linting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,3 +48,6 @@ src/*/_version.py | |
| /tokens.json | ||
|
|
||
| .DS_Store | ||
|
|
||
| # Pyright | ||
| pyrightconfig.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| from typing import TYPE_CHECKING | ||
| from typing import Any | ||
| from typing import Optional | ||
|
|
||
| from requests.adapters import HTTPAdapter as BaseHttpAdapter | ||
|
|
||
| if TYPE_CHECKING: | ||
| from ssl import SSLContext | ||
|
|
||
| from urllib3 import PoolManager | ||
|
|
||
|
|
||
| class _SSLContextAdapterMixin: | ||
| """Mixin to add the ``ssl_context`` constructor argument to HTTP adapters. | ||
|
|
||
| The additional argument is forwarded directly to the pool manager. This allows us | ||
| to dynamically decide what SSL store to use at runtime, which is used to implement | ||
| the optional ``truststore`` backend. | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| *, | ||
| ssl_context: Optional["SSLContext"] = None, | ||
| **kwargs: Any, | ||
| ) -> None: | ||
| self._ssl_context = ssl_context | ||
| super().__init__(**kwargs) | ||
|
|
||
| def init_poolmanager( | ||
| self, | ||
| connections: int, | ||
| maxsize: int, | ||
| block: bool = False, | ||
| **pool_kwargs: Any, | ||
| ) -> "PoolManager": | ||
| if self._ssl_context is not None: | ||
| pool_kwargs.setdefault("ssl_context", self._ssl_context) | ||
| return super().init_poolmanager( # type: ignore[misc] | ||
| connections=connections, | ||
| maxsize=maxsize, | ||
| block=block, | ||
| **pool_kwargs, | ||
| ) | ||
|
|
||
|
|
||
| class HTTPAdapter(_SSLContextAdapterMixin, BaseHttpAdapter): | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should ssl_verify in this init support str?
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.
This should be the standard
Union[bool,str]now, based on how it is in the conda code.