You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of csaf_downloader does not use proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) due to missing configuration in the HTTP client's Transport. This leads to issues when running the tool in environments that require proxy settings for network requests.
Steps to Reproduce
Set up a network environment that requires proxy usage:
Run csaf_downloader to download from a URL that requires proxy access.
Observe that the requests bypass the proxy and fail to connect.
Expected Behavior
The tool should use the proxy settings defined in the environment variables and route all HTTP and HTTPS traffic through the configured proxy.
Actual Behavior
The tool bypasses the proxy, causing connection failures in proxied environments.
Root Cause
The http.Client instances in the codebase are created with a custom http.Transport but do not include the Proxy field set to http.ProxyFromEnvironment. As a result, the proxy configuration from environment variables is ignored.
The Proxy field is missing here, so no proxy is used for outgoing requests.
Proposed Solution
Update all instances of &http.Transport{...} in the codebase to include Proxy: http.ProxyFromEnvironment. This ensures that the proxy settings from the environment are respected.
This issue affects users in corporate or secured environments that require proxy configurations to access external resources. Fixing it improves compatibility and ensures expected behavior.
Steps to Verify
Apply the proposed fix.
Run the tool with proxy environment variables set.
Verify that traffic routes through the proxy.
Set the NO_PROXY variable for specific domains and confirm they bypass the proxy.
Description
The current implementation of
csaf_downloader
does not use proxy environment variables (HTTP_PROXY
,HTTPS_PROXY
,NO_PROXY
) due to missing configuration in the HTTP client'sTransport
. This leads to issues when running the tool in environments that require proxy settings for network requests.Steps to Reproduce
csaf_downloader
to download from a URL that requires proxy access.Expected Behavior
The tool should use the proxy settings defined in the environment variables and route all HTTP and HTTPS traffic through the configured proxy.
Actual Behavior
The tool bypasses the proxy, causing connection failures in proxied environments.
Root Cause
The
http.Client
instances in the codebase are created with a customhttp.Transport
but do not include theProxy
field set tohttp.ProxyFromEnvironment
. As a result, the proxy configuration from environment variables is ignored.For example:
The
Proxy
field is missing here, so no proxy is used for outgoing requests.Proposed Solution
Update all instances of
&http.Transport{...}
in the codebase to includeProxy: http.ProxyFromEnvironment
. This ensures that the proxy settings from the environment are respected.Example updated code:
Impact
This issue affects users in corporate or secured environments that require proxy configurations to access external resources. Fixing it improves compatibility and ensures expected behavior.
Steps to Verify
NO_PROXY
variable for specific domains and confirm they bypass the proxy.Additional Context
http.ProxyFromEnvironment
net/http
.The text was updated successfully, but these errors were encountered: