I had this same problem and discovered that my proxy settings for my network connection were wrong. To fix, I did the following:
1. Clicked on wireless network icon in upper right of screen
2. Selected "Open Network Preferences"
3. Selected the network interface I was using - in my case Ethernet
4. Selected the Advanced button in the lower right
5. Selected the Proxies Tab
6. Corrected my proxy server settings - in my case I did not have a port number set for my HTTPS proxy server.
From what I can tell, Itunes uses both HTTP and HTTPS protocols to connect to Itunes Store and to log in to Itunes Account (respectively). If you are on a network that requires you to use a proxy server, then you will have to make sure each of these protocols is set to use the correct proxy server URL and Port Number. Also, if you are on a network that does not use a proxy server, you need to make sure you don't have a proxy server set for these protocols.
Ideally, the proxy server settings are handled for you automatically when you connect to a new network, this isn't alwys the case however. Some older network don't support automatic configuration of the proxy server settings and you are forced to manually set the configuration. Most wireless and home networks I've run into don't use proxy servers, they are typically only used in large corporations to reduce network load on the intranet, or to manage external security threats.
Good luck