So I just installed Android Studio again after a long time and it asked me to configure the proxy, so I did. I tested the connection and it worked.
Then it asked me
When I got this error I used Charles Proxy app(even thought Charles Proxy was completely closed). To solve it I just disabled SSL Proxying inside Charles Proxy
After that I got
Cause: unable to find valid certification path to requested target
//and
Connection refused
To solve it just close Charles Proxy(with disabled(stopped) SSL Proxying) and restart Android Studio or analyse traffic and exclude unnecessary host(Proxy -> SSL Proxy Settings... -> Exclude block). In my case it was
.cloudfront.net