amazon-web-services - Setting up local https network to mock amazonaws.com in docker
问题描述
I have a requirement where I need to setup a spoof/mock an AWS server in my local docker compose network... The requirement is to be able to test a set of microservice without letting the microservices know that the endpoint is not actually AWS.
For examples if a microservice, which uses the AWS-SDK, tries to make a service call to create a queue, it makes a call to https://eu-west-1.queue.amazonaws.com. I have a local dns server installed which resolves the same to a reverse proxy server(Traefik) which in turn resolves it to the mock server.
When the service call is made, the service call fails at reverse proxy level stating the below error
traefik_1 | time="2018-10-11T15:11:28Z" level=debug msg="http: TLS handshake error from 10.5.0.7:59058: remote error: tls: unknown certificate authority"
can anyone help me in setting up the system in such a way that the call is made successfully....
解决方案
您将无法 MITM https api 请求并返回不同的响应。您可以为 SDK 提供一个不同的 URL 来访问(不使用 https,或使用自签名证书),然后设置一个代理,以在您希望将请求发送到亚马逊时将请求代理到亚马逊,并在您希望将请求发送到您的其他服务时你想嘲笑他们。
有关如何更改 javascript SDK 中的 api 请求 url 的一些随机信息:https ://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/specifying-endpoints.html (例如)
推荐阅读
- html - react js中的动态可编辑输入字段
- javascript - Discord 机器人不再启动
- apache-spark - 如何在典型的 ML 模型中加载 Spark 流模型或将经过训练的典型 ML 模型加载到流 ML 模型中?
- reactjs - 我正在尝试安装 create-react-app,但它无法正常工作。有人可以帮忙吗?
- laravel - 未定义的变量:_instance - 带有 laravel livewire 的 Summernote 编辑器
- java - 如何解决 org.openqa.selenium.WebDriverException:会话未启动或终止
- android - EditText.getText() 返回空字符串,其中 EditText 不为空;它由 android:hint="Enter Bus Number" 设置
- javascript - React.js,使用 find() 搜索状态
- python - LAB:对电视节目进行排序(字典和列表)
- javascript - 原型对象内的对象或数组的值如何受实例使用的影响?