Skip to content

Commit 4d1abca

Browse files
authored
Respect original ssl_verify values (#860)
* pass ssl_verify as env var * add news * assert context items were kept * first item
1 parent d5efecb commit 4d1abca

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

constructor/fcp.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,16 +451,18 @@ def main(info, verbose=True, dry_run=False, conda_exe="conda.exe"):
451451
# We need to preserve the configuration for proxy servers and ssl, otherwise if constructor is
452452
# running in a host that sits behind proxy (usually in a company / corporate environment) it
453453
# will have this settings reset with the call to conda_replace_context_default
454+
# We can pass ssl_verify via env var, but proxy_servers is a mapping so we need to do it by hand
454455
# See: https://github.com/conda/constructor/issues/304
455456
proxy_servers = conda_context.proxy_servers
456-
ssl_verify = conda_context.ssl_verify
457-
457+
_ssl_verify = conda_context.ssl_verify
458458
with env_vars({
459459
"CONDA_PKGS_DIRS": download_dir,
460+
"CONDA_SSL_VERIFY": str(conda_context.ssl_verify),
460461
}, conda_replace_context_default):
461-
# Restoring the state for both "proxy_servers" and "ssl_verify" to what was before
462+
# Restoring the state for "proxy_servers" to what it was before
462463
conda_context.proxy_servers = proxy_servers
463-
conda_context.ssl_verify = ssl_verify
464+
assert conda_context.ssl_verify == _ssl_verify
465+
assert conda_context.pkgs_dirs and conda_context.pkgs_dirs[0] == download_dir
464466

465467
(
466468
pkg_records,

news/860-ssl-verify

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Enhancements
2+
3+
* <news item>
4+
5+
### Bug fixes
6+
7+
* Respect `ssl_verify` setting if defined in any `condarc` file. (#851 via #860)
8+
9+
### Deprecations
10+
11+
* <news item>
12+
13+
### Docs
14+
15+
* <news item>
16+
17+
### Other
18+
19+
* <news item>

0 commit comments

Comments
 (0)