Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion Tasks/Common/coveragepublisher/coveragepublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,25 @@ async function publishCoverage(inputFiles: string[], reportDirectory: string, pa
"PIPELINES_COVERAGEPUBLISHER_DEBUG": taskLib.getVariable('PIPELINES_COVERAGEPUBLISHER_DEBUG'),
"HTTPS_PROXY": process.env['HTTPS_PROXY'],
"NO_PROXY": process.env['NO_PROXY'],
"DOTNET_SYSTEM_GLOBALIZATION_INVARIANT": taskLib.getVariable('DOTNET_SYSTEM_GLOBALIZATION_INVARIANT')
"DOTNET_SYSTEM_GLOBALIZATION_INVARIANT": taskLib.getVariable('DOTNET_SYSTEM_GLOBALIZATION_INVARIANT'),
// NTLM proxy support
"NTLM_PROXY": process.env['NTLM_PROXY'] || taskLib.getVariable('NTLM_PROXY'),
"NTLM_USERNAME": process.env['NTLM_USERNAME'] || taskLib.getVariable('NTLM_USERNAME'),
"NTLM_PASSWORD": process.env['NTLM_PASSWORD'] || taskLib.getVariable('NTLM_PASSWORD'),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NTLM_PASSWORD may be supplied via environment variables (process.env). When values are pulled from process.env, they aren’t automatically masked by the Azure Pipelines agent, so the password could leak into logs. It would be safer to always use taskLib.getVariable() for these secrets and to call taskLib.setSecret() so they’re obfuscated in logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not get this, shall I use the NTLM_password parameter or shall i remove it? If I need to keep it how should i update?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually here if we are offering a way to enter the ntlm password then yah no choice, we can't avoid it, so ignore my original comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we are not using the same proxy that the agent was setup with? Essentially why do we need separate variables in this task for proxy is the agent running without proxy and only this task needs the proxy ?

Ideally we shuold not have a separate proxy for specific task. If this is needed can you elaborate on the sceanrio why this task needs different proxy ?

"NTLM_DOMAIN": process.env['NTLM_DOMAIN'] || taskLib.getVariable('NTLM_DOMAIN'),
"HTTP_PROXY": process.env['HTTP_PROXY'],
// SSL/TLS configuration for NTLM proxy
"DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER": "0", // Use WinHttpHandler on Windows for better proxy support
"DOTNET_SYSTEM_NET_HTTP_USEWINHTTP": "true", // Force WinHTTP on Windows
"DOTNET_SYSTEM_NET_DISABLEIPV6": process.env['DOTNET_SYSTEM_NET_DISABLEIPV6'] || "false",
// SSL certificate validation options for problematic proxies
"DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT": "false", // Disable HTTP/2 if causing issues
// Additional SSL/TLS fixes for NTLM proxy issues
"DOTNET_SYSTEM_NET_HTTP_USESYSTEMDEFAULTCREDENTIALS": "true", // Use system credentials for proxy auth
"DOTNET_SYSTEM_NET_HTTP_ALLOWUNENCRYPTEDHTTP2": "false", // Ensure encrypted connections
"DOTNET_SYSTEM_NET_SECURITY_ALLOWINSECURERENEGOTIATION": process.env['DOTNET_SYSTEM_NET_SECURITY_ALLOWINSECURERENEGOTIATION'] || "false",
// Additional proxy bypass options
"PROXY_BYPASS_ON_LOCAL": process.env['PROXY_BYPASS_ON_LOCAL'] || taskLib.getVariable('PROXY_BYPASS_ON_LOCAL'),
};

await dotnet.exec({
Expand Down
2 changes: 1 addition & 1 deletion Tasks/PublishCodeCoverageResultsV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 259,
"Minor": 262,
"Patch": 0
},
"demands": [],
Expand Down
2 changes: 1 addition & 1 deletion Tasks/PublishCodeCoverageResultsV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 259,
"Minor": 262,
"Patch": 0
},
"demands": [],
Expand Down