- Newest
- Most votes
- Most comments
Hello Nithin, I understand you're having trouble configuring AWS CLI to work through a proxy on both Windows and Linux guest VMs. Let's address this issue step by step. Remember to always follow security best practices when configuring your AWS CLI and handling credentials. Regularly rotate your access keys and use the principle of least privilege when assigning permissions. Let's break this down.
-
Verify proxy configuration: Ensure that the proxy settings are correctly configured in your environment variables. For Windows, you can set these in the System Properties or use the following commands in PowerShell:
$env:HTTP_PROXY="http://your_proxy:your_port" $env:HTTPS_PROXY="http://your_proxy:your_port"
-
For Linux, you can set these in your shell profile or use:
export HTTP_PROXY="http://your_proxy:your_port" export HTTPS_PROXY="http://your_proxy:your_port"
-
Check AWS CLI configuration: Ensure that your AWS CLI is properly configured with your credentials. Run:
aws configure
Enter your AWS Access Key ID, Secret Access Key, default region, and output format.
Test the connection: Try running a simple AWS CLI command to test the connection, such as:
aws s3 ls
Verify proxy authentication: If your proxy requires authentication, include the username and password in the proxy URL:
-
Check firewall settings: Ensure that your firewall is not blocking the AWS CLI from accessing the internet through the proxy.
Use the --no-verify-ssl option: If you're still encountering SSL verification issues, you can try:
aws s3 ls --no-verify-ssl
Note: This is not recommended for production use due to security implications.
-
Check proxy logs: If possible, check the proxy server logs to see if there are any errors or blocked requests.
Use AWS CLI proxy options: You can also specify the proxy directly in the AWS CLI command:
aws s3 ls --proxy http://your_proxy:your_port
Verify no_proxy settings: Ensure that the no_proxy environment variable doesn't include AWS endpoints.
If you're still encountering issues after trying the above steps, I recommend:
- Double-check that the proxy settings are correct and that the proxy server is functioning properly.
- Verify that your AWS credentials are valid and have the necessary permissions.
- Try using the AWS CLI from a non-proxied network to isolate whether the issue is specific to the proxy configuration.
If you are still not able to resolve this issue, I would recommend reaching out to AWS Support for further assistance, as they can provide more tailored troubleshooting based on your specific account and network configuration.
Additional Resources:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2config-proxy.html
https://docs.aws.amazon.com/iot/latest/developerguide/configure-local-proxy-web-proxy.html
https://repost.aws/questions/QUAAQQbjDUSGa5wRjNftXVnA/vpn-or-proxy-or-secure-connection
Hopefully this helps provide a resolution.
Best of luck and thank you for using AWS!
Brian
answered 2 years ago
Relevant content
asked 6 months ago
asked 3 years ago

Hello,
we have a similar issue where the CLI is not working behind our customer's Production proxy but it is working when behind the Pre-production proxy.
After a thorough investigation, the Wireshark tracing seems to suggest that the AWS CLI is using HTTP 1.0 and HTTP 1.0 is blocked by the production proxy.
Is there a way to tell the AWS CLI to use HTTP 1.1 instead? How can we justify to the customer that HTTP 1.0 is preferred?
Thanks Christian