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

Feat: Added option to disable SSL verify #3676

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ed1819c
feat: add trusted option to repository on develop branch, but require…
Celeborn2BeAlive May 29, 2020
7c056a7
removed redundant double check of http scheme
maayanbar13 Sep 12, 2020
af7b1e7
Added trusted source tests and fixture to test_factory
maayanbar13 Sep 12, 2020
c3dccac
Added trusted source tests to pip_installer
maayanbar13 Sep 12, 2020
92dad18
Merge branch 'master' of https://github.com/python-poetry/poetry into…
maayanbar13 Feb 6, 2021
2304072
Implemented saving trusted state in cert configuration
maayanbar13 Feb 7, 2021
e0711ca
Fixed handling trusted as str and being overriden by default certific…
maayanbar13 Feb 8, 2021
f4c52a7
doc: Added docs about configurating trusted repositories in poetry co…
maayanbar13 Feb 10, 2021
9e40186
fix: Fixed bug where warnings are not reset to default when the reque…
maayanbar13 Feb 10, 2021
423236a
Apply suggestions from code review
maayanbar13 Aug 19, 2021
624c7ce
Fixed conflicts with latest upstream
maayanbar13 Aug 19, 2021
0270182
Fixed typo in get_truested
maayanbar13 Sep 25, 2021
514a531
Merge branch 'option-to-disable-ssl-verify-develop' of https://github…
maayanbar13 Sep 25, 2021
1be75fa
Fixed merge conflicts with latest changes
maayanbar13 Mar 28, 2022
20b31e6
Fixed lint issues
maayanbar13 Apr 7, 2022
28f5087
Fixed merge conflicts
maayanbar13 Apr 21, 2022
b90c3db
Fixed fstring formatting according to pyupgrade
maayanbar13 Apr 21, 2022
54656d3
Merged latest changes
maayanbar13 May 27, 2022
be3e319
Added trusted host verification for authenticator and legacy reposito…
maayanbar13 May 27, 2022
986fb2b
Updated tests according to authenticator changes
maayanbar13 May 27, 2022
270ceb1
Reverted small changes relative to dev
maayanbar13 May 27, 2022
61a65a7
Moved trusted option to seperate property then certs
maayanbar13 May 27, 2022
cbac250
Fixed test monkeypatch
maayanbar13 May 28, 2022
8b84ca6
Fixed acciderntaly deleted files in conflict merge and moved the trus…
maayanbar13 May 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ poetry config -- http-basic.pypi myUsername -myPasswordStartingWithDash
### Custom certificate authority and mutual TLS authentication

Poetry supports repositories that are secured by a custom certificate authority as well as those that require
certificate-based client authentication. The following will configure the "foo" repository to validate the repository's
certificate-based client authentication. The following will configure the "foo" repository to validate the repository's
certificate using a custom certificate authority and use a client certificate (note that these config variables do not
both need to be set):

Expand All @@ -384,6 +384,14 @@ poetry config certificates.foo.cert /path/to/ca.pem
poetry config certificates.foo.client-cert /path/to/client.pem
```

### Trusting a repository

You can bypass SSL verification for a repository if you know it can be trusted (useful for private repositories):

```bash
poetry config certificates.foo.trusted true
```

## Caches

Poetry employs multiple caches for package sources in order to improve user experience and avoid duplicate network
Expand Down
19 changes: 17 additions & 2 deletions src/poetry/console/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,31 @@ def handle(self) -> int | None:

# handle certs
m = re.match(
r"(?:certificates)\.([^.]+)\.(cert|client-cert)", self.argument("key")
r"(?:certificates)\.([^.]+)\.(cert|client-cert|trusted)",
self.argument("key"),
)
if m:
key = f"certificates.{m.group(1)}.{m.group(2)}"
if self.option("unset"):
config.auth_config_source.remove_property(
f"certificates.{m.group(1)}.{m.group(2)}"
)

return 0

if m.group(2) == "trusted":
from poetry.config.config import boolean_normalizer
from poetry.config.config import boolean_validator

self._handle_single_value(
config.auth_config_source,
key,
(
boolean_validator,
boolean_normalizer,
False,
),
values,
)
if len(values) == 1:
config.auth_config_source.add_property(
f"certificates.{m.group(1)}.{m.group(2)}", values[0]
Expand Down