Had it myself for some time. Same exact error message.
The cause was my /etc/hosts file.
cat /etc/hosts | grep apple
I had there:
0.0.0.0 gdmf.apple.com
I don't have any idea how it got there, but it was there and it blocked my computer from reaching Apple servers. Commenting that 1 line resolved the issue for me.
Make sure your computer doesn't block connection to gdmf.apple.com in any other way.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: