-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
While in the mock mode, I cannot upload a file. The PUT
request is sent to the https
endpoint instead of the http
#5320
Comments
@sakhmedbayev could you provide what is in your aws-exports.js file? |
Thanks for reply @nikhname. Here it is
|
It seems the flag to http is set. Can you also tell how are you making upload call to mock S3 in your app so that I can reproduce the error? |
@sakhmedbayev What's the aws-amplify lib version you're using on your client? |
Thanks for the reply @kaustavghosh06. I am using the following versions:
|
@akshbhu, here is how I am doing it:
|
Transferring this issue to amplify-js. I believe the issue is with new major version release where underlying aws-sdk-js-v3 is not honoring the overridden end point protocol. I have an issue opened with them. |
Is there any news on this issue? Please let us know. |
Hi! Have the same behavior Amplify CLI version: |
Any update on this issue? Same behavior over here: Amplify CLI: 4.20.0 |
Also getting this issue, CLI version 4.20.0, |
Hi please try with the latest version of amplify (try removing the node_modules and lock files if required.) There is currently another bug with Storage.Put which we are working on priority right now #5876 |
Same here. Some services need Https, especially with federated auths. |
Just upgraded to @aws-amplify/cli 4.21.0 and is still an issue. |
@elchinillo and @BernhardSmuts what's the amplify-js version are you using? Are you still facing issues with using Storage in mock mode? |
Hi, @Amplifiyer. using Amplify version: 4.21.0 I have recreated my test code for this and it is as follows: My schema.graphql file has the following:
Using ReactJS, The select image and upload image functions are as follows:
This works fine when using with the actual AWS services... and after upload I get returned the key which in this case is I am hosting the ReactJS app using However, the problem comes in when I try and mock the storage. I get the following: In the console: In the network tab: In the network request: AWS mock server: and the aws_exports file when running in mock is as follows: To the best of my understanding, the S3 request is being done over HTTPS as can be seen in the network tab, but the AWS server is hosting the mock endpoint over HTTP. I have also allowed the Insecure setting in Google Chrome for the AWS endpoints. |
I actually resorted to changing the AppSync endpoint port to 20005, on which I was running an |
Cool, thanks will try something like this. The whole point of mock it to not have to go through all those configs. It would be nice if they could let you define the SSL env to run mock on. |
I agree completely, there was a relevant conversation here but it still feels like a design oversight. These are the commands I'm using with mitmproxy # 109 is my local IP obviously
mitmdump -p 20006 --mode reverse:http://192.168.1.109:20002/
mitmdump -p 443 --mode reverse:http://192.168.1.109:20005/ And then you add an entry in $ cat /etc/hosts
# other stuff
# ...
127.0.0.1 apps3bucketname-dev.s3.eu-west-2.amazonaws.com And then remove the "dangerously_connect_etc_etc" entries from your aws_exports. |
I'm using aws-amplify@3.0.11 Here is what I get when I run
|
@elchinillo can you try with the latest aws-amplify version and not the amplify-cli? Regarding the https end point, it is outside the scope of this issue. Please open a new feature request for that. |
I'll try again over the weekend. Regarding the https endpoint, isn't that why this issue started? |
No, the issue was started because amplify-js library was incorrectly sending requests to https endpoint instead of the server running on http end point. |
@elchinillo were you able to test the latest? Please let us know. |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Describe the bug
While in the mock mode, I cannot upload a file. The
PUT
request is sent to thehttps
endpoint instead of thehttp
Amplify CLI Version
4.13.4
To Reproduce
amplify add auth
amplify add storage
amplify mock
Mock Storage endpoint is running at http://localhost:20005
PUT https://localhost:20005/my-bucket-name/public/my-file.png?x-id=PutObject net::ERR_SSL_PROTOCOL_ERROR
Expected behavior
to be able to upload a file and see it in
amplify/mock-data/S3/my-bucket
directoryDesktop (please complete the following information):
The text was updated successfully, but these errors were encountered: