$ aws s3 ls s3://
Connection was closed before we received a valid response from endpoint URL:
"https://s3.amazonaws.com/".
What could be the problem?
At first I had the same problem but there are about 2 things that helped solve the error. First, I was using Kaspersky cloud protection and when I turned it off, after a few hours the program worked just swiftly.
The second solution was to use an IP addresses and this really worked out as I kept on trying it with VPN on and OFF several times, Whenever I could connect the VPN, this worked and whenever I disconnected it, it failed and brought the same error to me.
Conclusion: This seems to be a problem due to the network connection and IP address blocking. At the time this error occured, I could not access any social media platform because in my country we have to pay to use the social media platforms. This appeared to me as a partial indicator for the problem above.
Hope this will help. Thanks