AWS CLI - Uploading files with curl

0

Hi there,

I'm trying to upload some files to a Device Farm project. The documentation of AWS CLI is pretty clear (thank you very munch!) and it's really easy to schedule a run with a bunch of sentences. In my case I've created an upload (providing a correct arn project). All is fine at this point, but once I try to upload the file with curl, providing the signed url, there is a SSL error:

curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to prod-us-west-2-uploads.s3-us-west-2.amazonaws.com:443

This is a very common curl error and is widely spreaded on the internet forums. It was impossible to find a solution related with Amazon (or similar problem).

So I hope someone on this forums faced a similar issue.

There is my log of curl -vk "signed amazon url":

  • TCP_NODELAY set
  • Expire in 200 ms for 4 (transfer 0x162218bb120)
  • Connected to prod-us-west-2-uploads.s3-us-west-2.amazonaws.com (52.218.128.5) port 443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
  • TLSv1.2 (IN), TLS handshake, Certificate (11):
  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  • TLSv1.2 (IN), TLS handshake, Server finished (14):
  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  • TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  • TLSv1.2 (OUT), TLS handshake, Finished (20):
  • OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to prod-us-west-2-uploads.s3-us-west-2.amazonaws.com:443

Finally my curl is using those libraries (just vanilla Curl Windows client):
OpenSSL 1.1.1a
brotli 1.0.7
libssh2 1.8.0
nghttp2 1.36.0
zlib 1.2.11

For any futher information just ask!
Thank you.

Hamena
已提問 5 年前檢視次數 1342 次
2 個答案
0

Hi

Thanks for reaching out
I am assuming you are following the documentation here
https://docs.aws.amazon.com/devicefarm/latest/developerguide/how-to-create-test-run.html#how-to-create-test-run-cli

To upload the app using signed url, the command is
curl -T MyAndroid.apk "https://prod-us-west-2-uploads.s3-us-west-2.amazonaws.com/ExampleURL"

If does not work, can u try the following things

  1. try without using enclosing url in double quotes
  2. I am assuming you are using windows. Can you try from a Ec2 instance or mac. I am trying to rule out the possibility of platform
已回答 5 年前
0

I did something wrong, not sure what. I realized when put the signed url in a browser, the answer bringed me some error message related keys and crendentials. I just reconfigured aws cli (aws configure), tried again and upload was SUCCEEDED.

By the way, corporate proxy had something to say... you must provide to curl commands proxy host, port and credentials if is authenticated. SSL erros could be thrown because this.

Thank you!

Edited by: Hamena on Feb 22, 2019 12:44 AM

Hamena
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南