I experienced two machine unable to connect via ssh or curl. Its hang or connection close before authentication. But Finally I found that they both has the same issue. How I solved it?
For ssh issue I saw that if I specify chipher algorithmn then problem got solved. So I ended up with following solution -
I add created a config file in ~/.ssh directory then write following line -
# ~/.ssh/config Host * KexAlgorithms ecdh-sha2-nistp521
But I faced the curl not working. It was my another problem. I finally saw that if I lower MTU value for my network interface then both problem got solve. We do not need to provide the ssh config solution.
By following command you can change MTU value. My MTU value was 1500 and I lower it to 1200
sudo ip li set mtu 1200 dev wlp3s0
sudo ifconfig wlp3s0 mtu 1200
There are many more bug in openssh package. So whenever you face a problem check bug list.