Skip to content

Conversation

@bastiandoetsch
Copy link
Contributor

Description

This PR implements comprehensive SSL certificate and proxy handling for CLI downloads in the Snyk Visual Studio plugin. The changes ensure that both the --insecure flag and proxy configurations are properly respected throughout the download process, improving compatibility with corporate environments that use custom certificates or proxy servers.

Key Changes:

  • Enhanced SnykWebClient to respect SSL and proxy settings from extension options
  • Enhanced SnykCliDownloader to use properly configured HttpClient with SSL and proxy support
  • Added SSL certificate validation bypass when IgnoreUnknownCA setting is enabled
  • Added automatic system proxy configuration for CLI downloads
  • Added comprehensive test coverage for SSL and proxy handling functionality

Fixes:

  • Fixed SSL certificate validation not respecting the IgnoreUnknownCA setting during CLI downloads
  • Fixed missing proxy configuration for CLI downloads

This addresses the requirements to:
✅ Respect the --insecure flag via IgnoreUnknownCA setting
✅ Handle custom certificates properly through SSL configuration
✅ Use proxy configuration everywhere for downloads

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

- Add SSL certificate validation bypass when IgnoreUnknownCA setting is enabled
- Add automatic system proxy configuration for CLI downloads
- Enhance SnykWebClient to respect SSL and proxy settings from extension options
- Enhance SnykCliDownloader to use properly configured HttpClient with SSL and proxy support
- Add comprehensive test coverage for SSL and proxy handling functionality
- Fix SSL certificate validation not respecting the IgnoreUnknownCA setting during CLI downloads
- Fix missing proxy configuration for CLI downloads

This ensures that both the --insecure flag and proxy configurations are properly
respected throughout the download process, improving compatibility with corporate
environments that use custom certificates or proxy servers.
@bastiandoetsch bastiandoetsch requested a review from a team as a code owner July 11, 2025 08:06
@snyk-io
Copy link

snyk-io bot commented Jul 11, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

Move the SSL and proxy handling improvements from [Unreleased] section
to version 2.3.0 as requested.
@bastiandoetsch bastiandoetsch marked this pull request as draft July 11, 2025 08:24
…-1299]

Remove redundant proxy configuration since HttpClient and WebClient use system
proxy by default. Keep only the essential SSL certificate validation bypass
for the --insecure flag (IgnoreUnknownCA setting).

Changes:
- Remove manual proxy configuration from SnykWebClient and SnykCliDownloader
- Keep only SSL certificate validation bypass when IgnoreUnknownCA is enabled
- Update tests to focus on essential SSL functionality
- Update changelog to reflect simplified approach

This results in cleaner, simpler code that relies on .NET's default proxy
behavior while still providing the necessary --insecure flag support.
Remove accidentally committed JetBrains IDE configuration files from git tracking
and add .idea/ to .gitignore to prevent future commits of IDE-specific files.
…IDE-1299]

Revert incorrect changes to GetLatestReleaseInfo method that attempted to parse
JSON response when the endpoint actually returns a simple version string.

The method now correctly:
- Downloads version string from the endpoint
- Cleans up the response (removes newlines)
- Creates LatestReleaseInfo object with the version string

Only minimal change kept: passing SnykOptions to SnykWebClient for SSL handling.
@bastiandoetsch bastiandoetsch marked this pull request as ready for review July 11, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants