-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Adding NTLM proxy support #21240
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
base: master
Are you sure you want to change the base?
Adding NTLM proxy support #21240
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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({ | ||
|
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.
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.
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.
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?
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.
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