Skip to content

Commit c587cef

Browse files
authored
Allow certificate bundling to skip if the proxy url isn't https (#43424)
1 parent bf33934 commit c587cef

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

eng/tools/azure-sdk-tools/devtools_testutils/proxy_startup.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ def start_test_proxy(request) -> None:
341341
"""
342342

343343
repo_root = ascend_to_root(request.node.items[0].module.__file__)
344-
check_certificate_location(repo_root)
344+
requires_https = PROXY_URL.startswith("https://")
345+
346+
if requires_https:
347+
check_certificate_location(repo_root)
345348

346349
if not PROXY_MANUALLY_STARTED:
347350
if check_availability() == 200:
@@ -367,13 +370,17 @@ def start_test_proxy(request) -> None:
367370
_LOGGER.info("Downloading and starting standalone proxy executable...")
368371
tool_name = prepare_local_tool(root)
369372

370-
# Always start the proxy with these two defaults set to allow SSL connection
371-
passenv = {
372-
"ASPNETCORE_Kestrel__Certificates__Default__Path": os.path.join(
373-
root, "eng", "common", "testproxy", "dotnet-devcert.pfx"
374-
),
375-
"ASPNETCORE_Kestrel__Certificates__Default__Password": "password",
376-
}
373+
if requires_https:
374+
# Always start the proxy with these two defaults set to allow SSL connection
375+
passenv = {
376+
"ASPNETCORE_Kestrel__Certificates__Default__Path": os.path.join(
377+
root, "eng", "common", "testproxy", "dotnet-devcert.pfx"
378+
),
379+
"ASPNETCORE_Kestrel__Certificates__Default__Password": "password",
380+
}
381+
else:
382+
passenv = {}
383+
377384
# If they are already set, override what we give the proxy with what is in os.environ
378385
passenv.update(os.environ)
379386

0 commit comments

Comments
 (0)