cross posting this from another thread, because it seems more appropriate to this than where I originally posted (couldn't find this thread again at first):
I had a similar problem, but wasn't related to going through a proxy (and its cause is still unknown).
Using a new (refurb) i7 quad core 15" from oct 2011, I can get into the app store fine from 10.7.3. After upgrading to 10.7.4 I get "connection failed" when logging in to the app store. I can log into my apple account from every other possible interface imaginable (itunes on the same machine, developer.apple.com, from app store on another machine running 10.6.8, from another machine in the Apple Store running 10.7.4, etc).
I tried the various things in this thread (and a few other) including changing a ton of certificates to Always Trust, with no effect. Tried creating a new keychain (no effect). Changing those certificates to always trust (no effect). I also tried installing the 10.7.4 combined system install over the top of the existing system.
I went to the apple store, demonstrated the problem there for the genius, and it was his first time seeing that problem. We rolled my system back to 10.7.3 and the app store works fine. The genius bar was closing down for the night by the time it finished, so we didn't update it to 10.7.4. I updated to 10.7.4 this morning, and the problem returns, exactly as previously manifested...
Time to roll back to 10.7.3
UPDATE: When rolling back to 10.7.3 it again wouldn't do it from the internal. I booted with the option key pressed and selected the internal restore drive to boot from. It then only showed me the restore drive (locked) and my still connected external (for time machine). I tried again from USB stick that I'd put a restore drive on last night, and that restore seems to be working.