Skip to content

Conversation

@pballou
Copy link

@pballou pballou commented Aug 14, 2025

Related GitHub Issue

Closes: #4446

Description

Fix Bedrock SSL errors behind corporate proxies by:

  • Using a NodeHttpHandler that:
    • Reads proxies (HTTPS_PROXY, HTTP_PROXY, ALL_PROXY) and custom CA bundles (NODE_EXTRA_CA_CERTS, AWS_CA_BUNDLE)
    • Honors VS Code settings (http.proxy and http.proxyStrictSSL)
    • Uses proxy-agent when a proxy is present and falls back to secure https.Agent otherwise
  • Adding dependencies: @smithy/node-http-handler and proxy-agent
  • Fixing type issues by adjusting tsconfig.json

Test Procedure

  1. pnpm install && cd src && pnpm vsix, then install the generated .vsix.

  2. In your shell:

    export NODE_EXTRA_CA_CERTS=/path/to/corp-root-ca.pem
    export AWS_CA_BUNDLE=/path/to/corp-root-ca.pem
    export HTTPS_PROXY=http://your.proxy:port
    export HTTP_PROXY=http://your.proxy:port
    export ALL_PROXY=http://your.proxy:port
    
  3. Configure VS Code:

    • http.proxy → your corporate proxy
    • http.proxyStrictSSL → true if providing the CA
  4. In Roo Code:

    • Use Amazon Bedrock provider via SSO or API key
    • Initiate a chat—expect no SSL errors.

Tested on macOS Sequoia 15.5 behind corporate proxy.

Documentation Updates

Does this PR necessitate updates to user-facing documentation?

  • No documentation updates are required.

Additional Notes

Secure defaults preserved. TLS not globally disabled.

Get in Touch

Discord: pattywaggon


Important

Fixes Bedrock SSL errors behind corporate proxies by adding a custom NodeHttpHandler in bedrock.ts to handle proxies and custom CAs.

  • Behavior:
    • Adds createNodeHttpHandler() in AwsBedrockHandler in bedrock.ts to handle proxies and custom CAs using NodeHttpHandler.
    • Honors VS Code settings (http.proxy, http.proxyStrictSSL) and environment variables (HTTPS_PROXY, HTTP_PROXY, ALL_PROXY, NODE_EXTRA_CA_CERTS, AWS_CA_BUNDLE).
    • Uses proxy-agent for proxy handling and https.Agent for direct connections.
  • Dependencies:
    • Adds @smithy/node-http-handler and proxy-agent to package.json.
  • Configuration:
    • Updates tsconfig.json to fix type issues.

This description was created by Ellipsis for b10e029. You can customize this summary. It will automatically update as commits are pushed.

@pballou pballou requested review from cte, jr and mrubens as code owners August 14, 2025 06:31
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Aug 14, 2025
Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! I've reviewed the changes and found some issues that need attention. The implementation correctly addresses the SSL validation issue with corporate proxies, but there are some critical type safety and error handling concerns that should be addressed.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 14, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 16, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 16, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Aug 21, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 25, 2025
@pballou pballou force-pushed the fix/issue-4446-ssl-validation branch from 131216d to eee9659 Compare September 7, 2025 04:32
@hannesrudolph hannesrudolph moved this from PR [Changes Requested] to PR [Needs Prelim Review] in Roo Code Roadmap Sep 17, 2025
@daniel-lxs
Copy link
Member

Hey @pballou Thank you for your contribution! I think the best solution to this is to create a centralized HTTP client and define all the proxy settings there, adding it only on bedrock means we are adding technical debt that needs to be dealt with later.

I'm closing this PR but feel free to continue the discussion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[BUG] TLS/SSL fails behind corporate proxies in v3.16.4+ (blocks Bedrock)

3 participants