aws-amplify / aws-amplify/amplify-cli
Compatibility with MITM (SSL inspection) proxies (e.g. zScaler)
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### Is this related to a new or existing Amplify category?
New category
### Is this related to another service?
_No response_
### Describe the feature you'd like to request
Allow users to provide a CA bundle for ssl certificate validation.
Many corporations are moving to SSL decrypting proxy servers which act as man-in-the-middle SSL inspector. When using a proxy like this, when a corporate computer tries to connect to any website (e.g. https://cloudformation.us-east-2.amazonaws.com/) it's actually connecting to a corporate proxy server which has it's own private certificate rather than the actual destination and real certificate. That proxy server then connect to the actual destination (e.g. amazonaws.com) and filters the traffic for malicious content.
This whole issue is not a problem for browsers and OS functions (windows, mac and linux) because the list of trusted Root CAs is configurable. So enterprises just have to update their laptop configs to add the new custom root ca to the trusted list, but this causes all kinds of havoc for tools that use Java, Python, NodeJS that have their own trust store rather than using the operating system's trust store.
Here is the error from the amplify init command:
```
Adding backend environment dev to AWS Amplify Console app: d35r8nqwd2ww1l
- Initializing project in the cloud...An error occurred when creating the CloudFormation stack
× Root stack creation failed
Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (_tls_wrap.js:1497:34)
at TLSSocket.emit (events.js:315:20)
at TLSSocket.EventEmitter.emit (domain.js:467:12)
at TLSSocket._finishInit (_tls_wrap.js:932:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:706:12) {
code: 'NetworkingError',
region: 'us-east-2',
hostname: 'cloudformation.us-east-2.amazonaws.com',
retryable: true,
time: 2021-05-13T18:09:40.945Z
}
```
### Describe the solution you'd like
The proper fix is to allow us to change the certificates considered valid on the client side. Other AWS CLI tools and SDKs use the AWS_CA_BUNDLE environment variable to allow the specification of custom root CAs.
https://docs.aws.amazon.com/sdkref/latest/guide/setting-global-ca_bundle.html
### Describe alternatives you've considered
A bad, but workable, solution to this would be to allow a user to disable SSL verification (which is covered on https://github.com/aws-amplify/amplify-cli/issues/1452)
The AWS CLI has a --no-verify-ssl option which does this.
### Additional context
_No response_
### Is this something that you'd be interested in working on?
- [X] 👋 I may be able to implement this feature request
- [ ] ⚠️ This feature might incur a breaking change
Contributor guide
Assessment
This issue has not been assessed yet.